From: Christoph Hellwig Date: Wed, 22 Jan 2020 16:29:44 +0000 (-0500) Subject: xfs: merge xfs_dir2_data_freescan and xfs_dir2_data_freescan_int X-Git-Tag: v5.5.0-rc0~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d85595d09af7924b1123e7c583e2264c901afc03;p=thirdparty%2Fxfsprogs-dev.git xfs: merge xfs_dir2_data_freescan and xfs_dir2_data_freescan_int 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 Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/libxfs_api_defs.h b/libxfs/libxfs_api_defs.h index 73adc644d..e887ee5e6 100644 --- a/libxfs/libxfs_api_defs.h +++ b/libxfs/libxfs_api_defs.h @@ -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 diff --git a/libxfs/xfs_dir2.h b/libxfs/xfs_dir2.h index a0cd423c7..34e7a0b64 100644 --- a/libxfs/xfs_dir2.h +++ b/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/libxfs/xfs_dir2_block.c b/libxfs/xfs_dir2_block.c index 35863ca63..b55136a1d 100644 --- a/libxfs/xfs_dir2_block.c +++ b/libxfs/xfs_dir2_block.c @@ -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); /* diff --git a/libxfs/xfs_dir2_data.c b/libxfs/xfs_dir2_data.c index 4697afab5..80b237a27 100644 --- a/libxfs/xfs_dir2_data.c +++ b/libxfs/xfs_dir2_data.c @@ -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. diff --git a/libxfs/xfs_dir2_leaf.c b/libxfs/xfs_dir2_leaf.c index e2699d822..c3b327220 100644 --- a/libxfs/xfs_dir2_leaf.c +++ b/libxfs/xfs_dir2_leaf.c @@ -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); /* diff --git a/libxfs/xfs_dir2_node.c b/libxfs/xfs_dir2_node.c index f9f77f2b4..76f9b590b 100644 --- a/libxfs/xfs_dir2_node.c +++ b/libxfs/xfs_dir2_node.c @@ -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); diff --git a/repair/dir2.c b/repair/dir2.c index 9fc980a2b..e43a97324 100644 --- a/repair/dir2.c +++ b/repair/dir2.c @@ -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")); diff --git a/repair/phase6.c b/repair/phase6.c index 09d54f50e..027c89795 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -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);