]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: xfs_alloc_fix_freelist() can use incore perag structures
authorDave Chinner <dchinner@redhat.com>
Fri, 31 Jul 2015 01:08:56 +0000 (11:08 +1000)
committerDave Chinner <david@fromorbit.com>
Fri, 31 Jul 2015 01:08:56 +0000 (11:08 +1000)
commit72bda06d0d46004417a777f449b7506ebafb76df
tree3a76750dbd5c698f396ddae04915d6496b2ecde2
parenta37f46d54f536f03f3bebc3b48d695584a058e4f
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>
libxfs/xfs_alloc.c
libxfs/xfs_alloc.h
libxfs/xfs_bmap.c