Get rid of these pointless wrappers.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
return 0;
action_list_init(&alist);
- ret = scrub_clean_health(ctx, &alist);
+ ret = scrub_meta_type(ctx, XFS_SCRUB_TYPE_HEALTHY, 0, &alist);
if (ret)
return ret;
goto maybe_trim;
/*
- * Check the summary counters early. Normally we do this during phase
- * seven, but some of the cross-referencing requires fairly accurate
+ * Check the resource usage counters early. Normally we do this during
+ * phase 7, but some of the cross-referencing requires fairly accurate
* summary counters. Check and try to repair them now to minimize the
* chance that repairs of primary metadata fail due to secondary
* metadata. If repairs fails, we'll come back during phase 7.
*/
action_list_init(&alist);
- ret = scrub_fs_counters(ctx, &alist);
+ ret = scrub_meta_type(ctx, XFS_SCRUB_TYPE_FSCOUNTERS, 0, &alist);
if (ret)
return ret;
return ret;
if (fsgeom.sick & XFS_FSOP_GEOM_SICK_QUOTACHECK) {
- ret = scrub_quotacheck(ctx, &alist);
+ ret = scrub_meta_type(ctx, XFS_SCRUB_TYPE_QUOTACHECK, 0,
+ &alist);
if (ret)
return ret;
}
return error;
}
-typedef int (*fs_scan_item_fn)(struct scrub_ctx *, struct action_list *);
-
struct fs_scan_item {
struct action_list alist;
bool *abortedp;
- fs_scan_item_fn scrub_fn;
+ unsigned int scrub_type;
};
/* Run one full-fs scan scrubber in this thread. */
nanosleep(&tv, NULL);
}
- ret = item->scrub_fn(ctx, &item->alist);
+ ret = scrub_meta_type(ctx, item->scrub_type, 0, &item->alist);
if (ret) {
str_liberror(ctx, ret, _("checking fs scan metadata"));
*item->abortedp = true;
struct workqueue *wq,
bool *abortedp,
xfs_agnumber_t nr,
- fs_scan_item_fn scrub_fn)
+ unsigned int scrub_type)
{
struct fs_scan_item *item;
struct scrub_ctx *ctx = wq->wq_ctx;
return ret;
}
action_list_init(&item->alist);
- item->scrub_fn = scrub_fn;
+ item->scrub_type = scrub_type;
item->abortedp = abortedp;
ret = -workqueue_add(wq, fs_scan_worker, nr, item);
* The nlinks scanner is much faster than quotacheck because it only
* walks directories, so we start it first.
*/
- ret = queue_fs_scan(&wq_fs_scan, &aborted, nr, scrub_nlinks);
+ ret = queue_fs_scan(&wq_fs_scan, &aborted, nr, XFS_SCRUB_TYPE_NLINKS);
if (ret)
goto wait;
if (nr_threads > 1)
nr++;
- ret = queue_fs_scan(&wq_fs_scan, &aborted, nr, scrub_quotacheck);
+ ret = queue_fs_scan(&wq_fs_scan, &aborted, nr,
+ XFS_SCRUB_TYPE_QUOTACHECK);
if (ret)
goto wait;
return scrub_group(ctx, XFROG_SCRUB_GROUP_SUMMARY, 0, alist);
}
-/* Scrub /only/ the superblock summary counters. */
-int
-scrub_fs_counters(
- struct scrub_ctx *ctx,
- struct action_list *alist)
-{
- return scrub_meta_type(ctx, XFS_SCRUB_TYPE_FSCOUNTERS, 0, alist);
-}
-
-/* Scrub /only/ the quota counters. */
-int
-scrub_quotacheck(
- struct scrub_ctx *ctx,
- struct action_list *alist)
-{
- return scrub_meta_type(ctx, XFS_SCRUB_TYPE_QUOTACHECK, 0, alist);
-}
-
-/* Scrub /only/ the file link counters. */
-int
-scrub_nlinks(
- struct scrub_ctx *ctx,
- struct action_list *alist)
-{
- return scrub_meta_type(ctx, XFS_SCRUB_TYPE_NLINKS, 0, alist);
-}
-
-/* Update incore health records if we were clean. */
-int
-scrub_clean_health(
- struct scrub_ctx *ctx,
- struct action_list *alist)
-{
- return scrub_meta_type(ctx, XFS_SCRUB_TYPE_HEALTHY, 0, alist);
-}
-
/* How many items do we have to check? */
unsigned int
scrub_estimate_ag_work(
struct action_list *alist);
int scrub_iscan_metadata(struct scrub_ctx *ctx, struct action_list *alist);
int scrub_summary_metadata(struct scrub_ctx *ctx, struct action_list *alist);
-int scrub_fs_counters(struct scrub_ctx *ctx, struct action_list *alist);
-int scrub_quotacheck(struct scrub_ctx *ctx, struct action_list *alist);
-int scrub_nlinks(struct scrub_ctx *ctx, struct action_list *alist);
-int scrub_clean_health(struct scrub_ctx *ctx, struct action_list *alist);
int scrub_meta_type(struct scrub_ctx *ctx, unsigned int type,
xfs_agnumber_t agno, struct action_list *alist);