summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_da_format.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-01-08 10:51:27 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2018-01-08 10:54:48 -0800
commitac503a4cc9e8ab574032e3e217ffb555f5bf2341 (patch)
treeb14f57348249c8e349a01e979dd1ec6c3d2edc84 /fs/xfs/libxfs/xfs_da_format.h
parentc368ebcd4cc3bbc08602adce083ad3cc76a15258 (diff)
downloadlinux-ac503a4cc9e8ab574032e3e217ffb555f5bf2341.tar.bz2
xfs: refactor the geometry structure filling function
Refactor the geometry structure filling function to use the superblock to fill the fields. While we're at it, make the function less indenty and use some whitespace to make the function easier to read. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_da_format.h')
-rw-r--r--fs/xfs/libxfs/xfs_da_format.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_da_format.h b/fs/xfs/libxfs/xfs_da_format.h
index 3771edcb301d..7e77299b7789 100644
--- a/fs/xfs/libxfs/xfs_da_format.h
+++ b/fs/xfs/libxfs/xfs_da_format.h
@@ -875,4 +875,10 @@ struct xfs_attr3_rmt_hdr {
((bufsize) - (xfs_sb_version_hascrc(&(mp)->m_sb) ? \
sizeof(struct xfs_attr3_rmt_hdr) : 0))
+/* Number of bytes in a directory block. */
+static inline unsigned int xfs_dir2_dirblock_bytes(struct xfs_sb *sbp)
+{
+ return 1 << (sbp->sb_blocklog + sbp->sb_dirblklog);
+}
+
#endif /* __XFS_DA_FORMAT_H__ */