summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_bmap.c
diff options
context:
space:
mode:
authorDave Chinner2015-06-22 02:04:31 +0200
committerDave Chinner2015-06-22 02:04:31 +0200
commit50adbcb4c4e6c94b3acaad2a5854b6ca57402115 (patch)
tree2805620a13234e0284c98023eb86eac762dc9fa6 /fs/xfs/libxfs/xfs_bmap.c
parentLinux 4.1-rc2 (diff)
downloadkernel-qcow2-linux-50adbcb4c4e6c94b3acaad2a5854b6ca57402115.tar.gz
kernel-qcow2-linux-50adbcb4c4e6c94b3acaad2a5854b6ca57402115.tar.xz
kernel-qcow2-linux-50adbcb4c4e6c94b3acaad2a5854b6ca57402115.zip
xfs: xfs_alloc_fix_freelist() can use incore perag structures
At the moment, xfs_alloc_fix_freelist() uses a mix of per-ag based access and agf buffer based access to freelist and space usage information. However, once the AGF buffer is locked inside this function, it is guaranteed that both the in-memory and on-disk values are identical. xfs_alloc_fix_freelist() doesn't modify the values in the structures directly, so it is a read-only user of the infomration, and hence can use the per-ag structure exclusively for determining what it should do. This opens up an avenue for cleaning up a lot of duplicated logic whose only difference is the structure it gets the data from, and in doing so removes a lot of needless byte swapping overhead when fixing up the free list. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.c')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index aeffeaaac0ec..1ad4f1a62ce0 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -3507,7 +3507,8 @@ xfs_bmap_longest_free_extent(
}
}
- longest = xfs_alloc_longest_free_extent(mp, pag);
+ longest = xfs_alloc_longest_free_extent(mp, pag,
+ XFS_MIN_FREELIST_PAG(pag, mp));
if (*blen < longest)
*blen = longest;