xfs: refactor dir format helpers
authorChristoph Hellwig <hch@lst.de>
Thu, 25 Apr 2024 13:17:03 +0000 (15:17 +0200)
committerChandan Babu R <chandanbabu@kernel.org>
Fri, 26 Apr 2024 05:51:46 +0000 (11:21 +0530)
commite58ac1770ded2a316447ca7608bb7809af82eca6
tree872ed3e02ec6d24782694ff4086f610bfdff87c3
parentdfe5febe2b6a175d730861441bff4f726fc58a6c
xfs: refactor dir format helpers

Add a new enum and a xfs_dir2_format helper that returns it to allow
the code to switch on the format of a directory in a single operation
and switch all helpers of xfs_dir2_isblock and xfs_dir2_isleaf to it.

This also removes the explicit xfs_iread_extents call in a few of the
call sites given that xfs_bmap_last_offset already takes care of it
underneath.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/libxfs/xfs_dir2.c
fs/xfs/libxfs/xfs_dir2.h
fs/xfs/libxfs/xfs_exchmaps.c
fs/xfs/scrub/dir.c
fs/xfs/scrub/readdir.c
fs/xfs/xfs_dir2_readdir.c