xfs: provide helper for counting extents from if_bytes
authorEric Sandeen <sandeen@sandeen.net>
Tue, 8 Nov 2016 01:59:42 +0000 (12:59 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 8 Nov 2016 01:59:42 +0000 (12:59 +1100)
commit5d829300bee000980a09ac2ccb761cb25867b67c
tree425daf3660774296f46973084bf7d8362b45723f
parent4dfce57db6354603641132fac3c887614e3ebe81
xfs: provide helper for counting extents from if_bytes

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>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_inode_fork.c
fs/xfs/libxfs/xfs_inode_fork.h
fs/xfs/xfs_bmap_util.c
fs/xfs/xfs_inode_item.c
fs/xfs/xfs_ioctl.c
fs/xfs/xfs_qm.c
fs/xfs/xfs_reflink.c