]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: merge xfs_dir2_data_freescan and xfs_dir2_data_freescan_int
authorChristoph Hellwig <hch@lst.de>
Wed, 22 Jan 2020 16:29:44 +0000 (11:29 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 22 Jan 2020 16:29:44 +0000 (11:29 -0500)
Source kernel commit: ae42976de7f1022e6d83f5560debc072929921a9

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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/libxfs_api_defs.h
libxfs/xfs_dir2.h
libxfs/xfs_dir2_block.c
libxfs/xfs_dir2_data.c
libxfs/xfs_dir2_leaf.c
libxfs/xfs_dir2_node.c
repair/dir2.c
repair/phase6.c

index 73adc644db94165a368a44722b9c26714a52a1a4..e887ee5e6f1da344ba53b1f28eb4a07fe34558c3 100644 (file)
@@ -82,7 +82,7 @@
 #define xfs_dir2_free_hdr_from_disk    libxfs_dir2_free_hdr_from_disk
 #define xfs_dir2_isblock               libxfs_dir2_isblock
 #define xfs_dir2_isleaf                        libxfs_dir2_isleaf
-#define xfs_dir2_data_freescan_int     libxfs_dir2_data_freescan_int
+#define xfs_dir2_data_freescan         libxfs_dir2_data_freescan
 #define xfs_dir2_data_log_entry                libxfs_dir2_data_log_entry
 #define xfs_dir2_data_log_header       libxfs_dir2_data_log_header
 #define xfs_dir2_data_make_free                libxfs_dir2_data_make_free
index a0cd423c79dd8c9d8e661125793e21e2c5be818b..34e7a0b64205b4e296d01415374be00fbf3f6438 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 35863ca634ad2db193f26704b0fd3620424e1233..b55136a1d1f63913bda28dc5a54465788ab08c4e 100644 (file)
@@ -308,7 +308,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);
 }
 
 /*
@@ -455,7 +455,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;
                }
                /*
@@ -545,7 +545,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);
@@ -804,7 +804,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);
@@ -1011,7 +1011,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 4697afab564ad1d0cbf3289b6d9cfdda0a53f87b..80b237a27e28fef8241e8edc2deab666755e9fca 100644 (file)
@@ -605,7 +605,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)
@@ -652,15 +652,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 e2699d822c058696977b75e1b7da2b7ba8861410..c3b327220fe7c30042a47ec94285edde88becb3c 100644 (file)
@@ -463,7 +463,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.
         */
@@ -870,7 +870,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);
        /*
index f9f77f2b43e17992140c50258ebe77154a81ccf7..76f9b590b05b28d87107eb45c5aeac06a0b7296d 100644 (file)
@@ -1325,7 +1325,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);
@@ -1973,7 +1973,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);
 
index 9fc980a2b4b10fff492ed5e3d94ca9abd6b74e24..e43a97324878d0c9397cd97303f9809ef4c3717d 100644 (file)
@@ -928,7 +928,7 @@ _("bad bestfree table in block %u in directory inode %" PRIu64 ": "),
                        da_bno, ino);
                if (!no_modify) {
                        do_warn(_("repairing table\n"));
-                       libxfs_dir2_data_freescan_int(mp, d, &i);
+                       libxfs_dir2_data_freescan(mp, d, &i);
                        *dirty = 1;
                } else {
                        do_warn(_("would repair table\n"));
index 09d54f50ed30ce433109e19571424b38fcd5ce6c..027c89795966b2e7fa172d61b55d843a2b66323c 100644 (file)
@@ -1939,7 +1939,7 @@ _("entry \"%s\" in dir inode %" PRIu64 " inconsistent with .. value (%" PRIu64 "
        }
        *num_illegal += nbad;
        if (needscan)
-               libxfs_dir2_data_freescan_int(mp, d, &i);
+               libxfs_dir2_data_freescan(mp, d, &i);
        if (needlog)
                libxfs_dir2_data_log_header(&da, bp);
        error = -libxfs_trans_commit(tp);