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: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
Christoph Hellwig 2019-11-08 15:06:02 -08:00 коммит произвёл Darrick J. Wong
Родитель 957ee13e20
Коммит ae42976de7
5 изменённых файлов: 12 добавлений и 23 удалений

Просмотреть файл

@ -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, extern int xfs_dir2_shrink_inode(struct xfs_da_args *args, xfs_dir2_db_t db,
struct xfs_buf *bp); struct xfs_buf *bp);
extern void xfs_dir2_data_freescan_int(struct xfs_mount *mp, extern void xfs_dir2_data_freescan(struct xfs_mount *mp,
struct xfs_dir2_data_hdr *hdr, int *loghead);
extern void xfs_dir2_data_freescan(struct xfs_inode *dp,
struct xfs_dir2_data_hdr *hdr, int *loghead); struct xfs_dir2_data_hdr *hdr, int *loghead);
extern void xfs_dir2_data_log_entry(struct xfs_da_args *args, extern void xfs_dir2_data_log_entry(struct xfs_da_args *args,
struct xfs_buf *bp, struct xfs_dir2_data_entry *dep); 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. * This needs to happen before the next call to use_free.
*/ */
if (needscan) 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. * This needs to happen before the next call to use_free.
*/ */
if (needscan) { if (needscan) {
xfs_dir2_data_freescan(dp, hdr, &needlog); xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog);
needscan = 0; needscan = 0;
} }
/* /*
@ -548,7 +548,7 @@ xfs_dir2_block_addname(
* Clean up the bestfree array and log the header, tail, and entry. * Clean up the bestfree array and log the header, tail, and entry.
*/ */
if (needscan) if (needscan)
xfs_dir2_data_freescan(dp, hdr, &needlog); xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog);
if (needlog) if (needlog)
xfs_dir2_data_log_header(args, bp); xfs_dir2_data_log_header(args, bp);
xfs_dir2_block_log_tail(tp, bp); xfs_dir2_block_log_tail(tp, bp);
@ -807,7 +807,7 @@ xfs_dir2_block_removename(
* Fix up bestfree, log the header if necessary. * Fix up bestfree, log the header if necessary.
*/ */
if (needscan) if (needscan)
xfs_dir2_data_freescan(dp, hdr, &needlog); xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog);
if (needlog) if (needlog)
xfs_dir2_data_log_header(args, bp); xfs_dir2_data_log_header(args, bp);
xfs_dir3_data_check(dp, 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. * Scan the bestfree if we need it and log the data block header.
*/ */
if (needscan) if (needscan)
xfs_dir2_data_freescan(dp, hdr, &needlog); xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog);
if (needlog) if (needlog)
xfs_dir2_data_log_header(args, dbp); xfs_dir2_data_log_header(args, dbp);
/* /*

Просмотреть файл

@ -608,7 +608,7 @@ xfs_dir2_data_freeremove(
* Given a data block, reconstruct its bestfree map. * Given a data block, reconstruct its bestfree map.
*/ */
void void
xfs_dir2_data_freescan_int( xfs_dir2_data_freescan(
struct xfs_mount *mp, struct xfs_mount *mp,
struct xfs_dir2_data_hdr *hdr, struct xfs_dir2_data_hdr *hdr,
int *loghead) 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. * Initialize a data block at the given block number in the directory.
* Give back the buffer for the created block. * 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); hdr->magic = cpu_to_be32(XFS_DIR3_DATA_MAGIC);
if (needscan) 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. * Set up leaf tail and bests table.
*/ */
@ -872,7 +872,7 @@ xfs_dir2_leaf_addname(
* Need to scan fix up the bestfree table. * Need to scan fix up the bestfree table.
*/ */
if (needscan) 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. * Need to log the data block's header.
*/ */
@ -1415,7 +1415,7 @@ xfs_dir2_leaf_removename(
* log the data block header if necessary. * log the data block header if necessary.
*/ */
if (needscan) if (needscan)
xfs_dir2_data_freescan(dp, hdr, &needlog); xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog);
if (needlog) if (needlog)
xfs_dir2_data_log_header(args, dbp); xfs_dir2_data_log_header(args, dbp);
/* /*

Просмотреть файл

@ -1328,7 +1328,7 @@ xfs_dir2_leafn_remove(
* Log the data block header if needed. * Log the data block header if needed.
*/ */
if (needscan) if (needscan)
xfs_dir2_data_freescan(dp, hdr, &needlog); xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog);
if (needlog) if (needlog)
xfs_dir2_data_log_header(args, dbp); xfs_dir2_data_log_header(args, dbp);
xfs_dir3_data_check(dp, 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. */ /* Rescan the freespace and log the data block if needed. */
if (needscan) if (needscan)
xfs_dir2_data_freescan(dp, hdr, &needlog); xfs_dir2_data_freescan(dp->i_mount, hdr, &needlog);
if (needlog) if (needlog)
xfs_dir2_data_log_header(args, dbp); xfs_dir2_data_log_header(args, dbp);