]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: provide helper for counting extents from if_bytes
authorEric Sandeen <sandeen@sandeen.net>
Tue, 10 Jan 2017 02:16:39 +0000 (20:16 -0600)
committerEric Sandeen <sandeen@redhat.com>
Tue, 10 Jan 2017 02:16:39 +0000 (20:16 -0600)
commitd09d4e5fcc560d8dcf3c87083298796a8ba14dd4
treeef69421a51b1fe53c4d5f00f1ec87829191cdbf6
parent6921638c63272a54194031f8cd95851cb9b18939
xfs: provide helper for counting extents from if_bytes

Source kernel commit: 5d829300bee000980a09ac2ccb761cb25867b67c

The open-coded pattern:

ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t)

is all over the xfs code; provide a new helper
xfs_iext_count(ifp) to count the number of inline extents
in an inode fork.

[dchinner: pick up several missed conversions]

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_bmap.c
libxfs/xfs_inode_fork.c
libxfs/xfs_inode_fork.h