aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-02-07 17:07:57 -0500
committerDarrick J. Wong <darrick.wong@oracle.com>2017-02-09 14:36:39 -0500
commit46694129816851cb323e4bcf2dc41482d8d6c19b (patch)
tree5555850ba16c4921005d8cab9f523158434be0de
parentebf55872616c7d4754db5a318591a72a8d5e6896 (diff)
xfs: improve busy extent sorting
Sort busy extents by the full block number instead of just the AGNO so that we can issue consecutive discard requests that the block layer could merge (although we'll need additional block layer fixes for fast devices). Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r--fs/xfs/xfs_extent_busy.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/xfs/xfs_extent_busy.c b/fs/xfs/xfs_extent_busy.c
index 4d850e27095e..ab062610234e 100644
--- a/fs/xfs/xfs_extent_busy.c
+++ b/fs/xfs/xfs_extent_busy.c
@@ -656,9 +656,17 @@ xfs_extent_busy_wait_all(
656int 656int
657xfs_extent_busy_ag_cmp( 657xfs_extent_busy_ag_cmp(
658 void *priv, 658 void *priv,
659 struct list_head *a, 659 struct list_head *l1,
660 struct list_head *b) 660 struct list_head *l2)
661{ 661{
662 return container_of(a, struct xfs_extent_busy, list)->agno - 662 struct xfs_extent_busy *b1 =
663 container_of(b, struct xfs_extent_busy, list)->agno; 663 container_of(l1, struct xfs_extent_busy, list);
664 struct xfs_extent_busy *b2 =
665 container_of(l2, struct xfs_extent_busy, list);
666 s32 diff;
667
668 diff = b1->agno - b2->agno;
669 if (!diff)
670 diff = b1->bno - b2->bno;
671 return diff;
664} 672}