xfs: merge xfs_dir2_data_freescan and xfs_dir2_data_freescan_int
authorChristoph Hellwig <hch@lst.de>
Fri, 8 Nov 2019 23:06:02 +0000 (15:06 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 11 Nov 2019 00:54:24 +0000 (16:54 -0800)
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@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/libxfs/xfs_dir2.h
fs/xfs/libxfs/xfs_dir2_block.c
fs/xfs/libxfs/xfs_dir2_data.c
fs/xfs/libxfs/xfs_dir2_leaf.c
fs/xfs/libxfs/xfs_dir2_node.c

index a0cd423..34e7a0b 100644 (file)
@@ -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);
index 0c481e5..358151d 100644 (file)
@@ -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);
        /*
index 0aa1d16..9e471a2 100644 (file)
@@ -608,7 +608,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)
@@ -655,15 +655,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.
index bc301c9..2c67a9e 100644 (file)
@@ -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.
         */
@@ -1415,7 +1415,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);
        /*
index 4ac7518..5f30a19 100644 (file)
@@ -1328,7 +1328,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);
@@ -1976,7 +1976,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);