On Fri, Nov 01, 2019 at 03:07:18PM -0700, Christoph Hellwig wrote: > There is no real need for xfs_dir2_data_freescan wrapper, so rename > xfs_dir2_data_freescan_int to xfs_dir2_data_freescan and let the > callers dereference the mount pointer from the inode. > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> Seems reasonable to me, Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --D > --- > fs/xfs/libxfs/xfs_dir2.h | 4 +--- > fs/xfs/libxfs/xfs_dir2_block.c | 10 +++++----- > fs/xfs/libxfs/xfs_dir2_data.c | 11 +---------- > fs/xfs/libxfs/xfs_dir2_leaf.c | 6 +++--- > fs/xfs/libxfs/xfs_dir2_node.c | 4 ++-- > 5 files changed, 12 insertions(+), 23 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_dir2.h b/fs/xfs/libxfs/xfs_dir2.h > index ccdbc612fb76..8bf4cf227740 100644 > --- a/fs/xfs/libxfs/xfs_dir2.h > +++ b/fs/xfs/libxfs/xfs_dir2.h > @@ -66,9 +66,7 @@ extern int xfs_dir2_isleaf(struct xfs_da_args *args, int *r); > extern int xfs_dir2_shrink_inode(struct xfs_da_args *args, xfs_dir2_db_t db, > struct xfs_buf *bp); > > -extern void xfs_dir2_data_freescan_int(struct xfs_mount *mp, > - struct xfs_dir2_data_hdr *hdr, int *loghead); > -extern void xfs_dir2_data_freescan(struct xfs_inode *dp, > +extern void xfs_dir2_data_freescan(struct xfs_mount *mp, > struct xfs_dir2_data_hdr *hdr, int *loghead); > extern void xfs_dir2_data_log_entry(struct xfs_da_args *args, > struct xfs_buf *bp, struct xfs_dir2_data_entry *dep); > diff --git a/fs/xfs/libxfs/xfs_dir2_block.c b/fs/xfs/libxfs/xfs_dir2_block.c > index 94d32e515478..4b3ea6730775 100644 > --- a/fs/xfs/libxfs/xfs_dir2_block.c > +++ b/fs/xfs/libxfs/xfs_dir2_block.c > @@ -311,7 +311,7 @@ xfs_dir2_block_compact( > * This needs to happen before the next call to use_free. > */ > if (needscan) > - xfs_dir2_data_freescan(args->dp, hdr, needlog); > + xfs_dir2_data_freescan(args->dp->i_mount, hdr, needlog); > } > > /* > @@ -458,7 +458,7 @@ xfs_dir2_block_addname( > * This needs to happen before the next call to use_free. > */ > if (needscan) { > - xfs_dir2_data_freescan(dp, hdr, &needlog); > + xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog); > needscan = 0; > } > /* > @@ -548,7 +548,7 @@ xfs_dir2_block_addname( > * Clean up the bestfree array and log the header, tail, and entry. > */ > if (needscan) > - xfs_dir2_data_freescan(dp, hdr, &needlog); > + xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog); > if (needlog) > xfs_dir2_data_log_header(args, bp); > xfs_dir2_block_log_tail(tp, bp); > @@ -807,7 +807,7 @@ xfs_dir2_block_removename( > * Fix up bestfree, log the header if necessary. > */ > if (needscan) > - xfs_dir2_data_freescan(dp, hdr, &needlog); > + xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog); > if (needlog) > xfs_dir2_data_log_header(args, bp); > xfs_dir3_data_check(dp, bp); > @@ -1014,7 +1014,7 @@ xfs_dir2_leaf_to_block( > * Scan the bestfree if we need it and log the data block header. > */ > if (needscan) > - xfs_dir2_data_freescan(dp, hdr, &needlog); > + xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog); > if (needlog) > xfs_dir2_data_log_header(args, dbp); > /* > diff --git a/fs/xfs/libxfs/xfs_dir2_data.c b/fs/xfs/libxfs/xfs_dir2_data.c > index 9752a0da5b95..4304c62796dd 100644 > --- a/fs/xfs/libxfs/xfs_dir2_data.c > +++ b/fs/xfs/libxfs/xfs_dir2_data.c > @@ -615,7 +615,7 @@ xfs_dir2_data_freeremove( > * Given a data block, reconstruct its bestfree map. > */ > void > -xfs_dir2_data_freescan_int( > +xfs_dir2_data_freescan( > struct xfs_mount *mp, > struct xfs_dir2_data_hdr *hdr, > int *loghead) > @@ -670,15 +670,6 @@ xfs_dir2_data_freescan_int( > } > } > > -void > -xfs_dir2_data_freescan( > - struct xfs_inode *dp, > - struct xfs_dir2_data_hdr *hdr, > - int *loghead) > -{ > - return xfs_dir2_data_freescan_int(dp->i_mount, hdr, loghead); > -} > - > /* > * Initialize a data block at the given block number in the directory. > * Give back the buffer for the created block. > diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c > index ff54c8f08ded..6912264e081e 100644 > --- a/fs/xfs/libxfs/xfs_dir2_leaf.c > +++ b/fs/xfs/libxfs/xfs_dir2_leaf.c > @@ -465,7 +465,7 @@ xfs_dir2_block_to_leaf( > hdr->magic = cpu_to_be32(XFS_DIR3_DATA_MAGIC); > > if (needscan) > - xfs_dir2_data_freescan(dp, hdr, &needlog); > + xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog); > /* > * Set up leaf tail and bests table. > */ > @@ -872,7 +872,7 @@ xfs_dir2_leaf_addname( > * Need to scan fix up the bestfree table. > */ > if (needscan) > - xfs_dir2_data_freescan(dp, hdr, &needlog); > + xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog); > /* > * Need to log the data block's header. > */ > @@ -1413,7 +1413,7 @@ xfs_dir2_leaf_removename( > * log the data block header if necessary. > */ > if (needscan) > - xfs_dir2_data_freescan(dp, hdr, &needlog); > + xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog); > if (needlog) > xfs_dir2_data_log_header(args, dbp); > /* > diff --git a/fs/xfs/libxfs/xfs_dir2_node.c b/fs/xfs/libxfs/xfs_dir2_node.c > index e51b103fd429..a131ed5e5f3b 100644 > --- a/fs/xfs/libxfs/xfs_dir2_node.c > +++ b/fs/xfs/libxfs/xfs_dir2_node.c > @@ -1322,7 +1322,7 @@ xfs_dir2_leafn_remove( > * Log the data block header if needed. > */ > if (needscan) > - xfs_dir2_data_freescan(dp, hdr, &needlog); > + xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog); > if (needlog) > xfs_dir2_data_log_header(args, dbp); > xfs_dir3_data_check(dp, dbp); > @@ -1970,7 +1970,7 @@ xfs_dir2_node_addname_int( > > /* Rescan the freespace and log the data block if needed. */ > if (needscan) > - xfs_dir2_data_freescan(dp, hdr, &needlog); > + xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog); > if (needlog) > xfs_dir2_data_log_header(args, dbp); > > -- > 2.20.1 >