aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_dir2_node.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-11-08 15:01:30 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2019-11-10 16:54:21 -0800
commit5893e4feb0eac11aab7b93ff9fe7e6e58bcec5ec (patch)
tree78e64769cd84be8918c8a608dafd0dda641aea3a /fs/xfs/libxfs/xfs_dir2_node.c
parentxfs: move the dir2 free header size to struct xfs_da_geometry (diff)
downloadlinux-dev-5893e4feb0eac11aab7b93ff9fe7e6e58bcec5ec.tar.xz
linux-dev-5893e4feb0eac11aab7b93ff9fe7e6e58bcec5ec.zip
xfs: move the max dir2 free bests count to struct xfs_da_geometry
Move the max free bests count towards our structure for dir/attr geometry parameters. 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/libxfs/xfs_dir2_node.c')
-rw-r--r--fs/xfs/libxfs/xfs_dir2_node.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2_node.c b/fs/xfs/libxfs/xfs_dir2_node.c
index b9d5f4ae9a8d..5d35a6d77b56 100644
--- a/fs/xfs/libxfs/xfs_dir2_node.c
+++ b/fs/xfs/libxfs/xfs_dir2_node.c
@@ -160,10 +160,9 @@ xfs_dir3_free_header_check(
struct xfs_buf *bp)
{
struct xfs_mount *mp = dp->i_mount;
+ int maxbests = mp->m_dir_geo->free_max_bests;
unsigned int firstdb;
- int maxbests;
- maxbests = dp->d_ops->free_max_bests(mp->m_dir_geo);
firstdb = (xfs_dir2_da_to_db(mp->m_dir_geo, fbno) -
xfs_dir2_byte_to_db(mp->m_dir_geo, XFS_DIR2_FREE_OFFSET)) *
maxbests;
@@ -562,8 +561,7 @@ xfs_dir2_free_hdr_check(
xfs_dir2_free_hdr_from_disk(dp->i_mount, &hdr, bp->b_addr);
- ASSERT((hdr.firstdb %
- dp->d_ops->free_max_bests(dp->i_mount->m_dir_geo)) == 0);
+ ASSERT((hdr.firstdb % dp->i_mount->m_dir_geo->free_max_bests) == 0);
ASSERT(hdr.firstdb <= db);
ASSERT(db < hdr.firstdb + hdr.nvalid);
}
@@ -1340,7 +1338,7 @@ xfs_dir2_leafn_remove(
struct xfs_dir3_icfree_hdr freehdr;
xfs_dir2_free_hdr_from_disk(dp->i_mount, &freehdr, free);
- ASSERT(freehdr.firstdb == dp->d_ops->free_max_bests(args->geo) *
+ ASSERT(freehdr.firstdb == args->geo->free_max_bests *
(fdb - xfs_dir2_byte_to_db(args->geo,
XFS_DIR2_FREE_OFFSET)));
}
@@ -1733,7 +1731,7 @@ xfs_dir2_node_add_datablk(
/* Remember the first slot as our empty slot. */
hdr->firstdb = (fbno - xfs_dir2_byte_to_db(args->geo,
XFS_DIR2_FREE_OFFSET)) *
- dp->d_ops->free_max_bests(args->geo);
+ args->geo->free_max_bests;
} else {
xfs_dir2_free_hdr_from_disk(mp, hdr, fbp->b_addr);
}
@@ -1743,7 +1741,7 @@ xfs_dir2_node_add_datablk(
/* Extend the freespace table if the new data block is off the end. */
if (*findex >= hdr->nvalid) {
- ASSERT(*findex < dp->d_ops->free_max_bests(args->geo));
+ ASSERT(*findex < args->geo->free_max_bests);
hdr->nvalid = *findex + 1;
hdr->bests[*findex] = cpu_to_be16(NULLDATAOFF);
}