aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/scrub/dir.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-11-08 14:58:05 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2019-11-10 16:54:21 -0800
commita84f3d5cb04f7dff1bf6904f0a05bc8df16137fb (patch)
tree99c8b71991efef1a63ad8102ad6d2d80795673bb /fs/xfs/scrub/dir.c
parentxfs: make the xfs_dir3_icfree_hdr available to xfs_dir2_node_addname_int (diff)
downloadlinux-dev-a84f3d5cb04f7dff1bf6904f0a05bc8df16137fb.tar.xz
linux-dev-a84f3d5cb04f7dff1bf6904f0a05bc8df16137fb.zip
xfs: add a bests pointer to struct xfs_dir3_icfree_hdr
All but two callers of the ->free_bests_p dir operation already have a struct xfs_dir3_icfree_hdr from a previous call to xfs_dir2_free_hdr_from_disk at hand. Add a pointer to the bests to struct xfs_dir3_icfree_hdr to clean up this pattern. To optimize this pattern, pass the struct xfs_dir3_icfree_hdr to xfs_dir2_free_log_bests instead of recalculating the pointer there. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/scrub/dir.c')
-rw-r--r--fs/xfs/scrub/dir.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/xfs/scrub/dir.c b/fs/xfs/scrub/dir.c
index 1314a9159156..b474c6f1926f 100644
--- a/fs/xfs/scrub/dir.c
+++ b/fs/xfs/scrub/dir.c
@@ -583,7 +583,6 @@ xchk_directory_free_bestfree(
struct xfs_dir3_icfree_hdr freehdr;
struct xfs_buf *dbp;
struct xfs_buf *bp;
- __be16 *bestp;
__u16 best;
unsigned int stale = 0;
int i;
@@ -604,9 +603,8 @@ xchk_directory_free_bestfree(
/* Check all the entries. */
xfs_dir2_free_hdr_from_disk(sc->ip->i_mount, &freehdr, bp->b_addr);
- bestp = sc->ip->d_ops->free_bests_p(bp->b_addr);
- for (i = 0; i < freehdr.nvalid; i++, bestp++) {
- best = be16_to_cpu(*bestp);
+ for (i = 0; i < freehdr.nvalid; i++) {
+ best = be16_to_cpu(freehdr.bests[i]);
if (best == NULLDATAOFF) {
stale++;
continue;