Commit ae42976d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: merge xfs_dir2_data_freescan and xfs_dir2_data_freescan_int

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 957ee13e
......@@ -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);
......
......@@ -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);
/*
......
......@@ -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.
......
......@@ -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);
/*
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment