]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove unnecessary parameter from scrub_scan_estimate_blocks
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 20 Nov 2020 22:03:28 +0000 (17:03 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 20 Nov 2020 22:03:28 +0000 (17:03 -0500)
The only caller that cares about the file counts uses it to compute the
number of files used, so return that and save a parameter.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
scrub/fscounters.c
scrub/fscounters.h
scrub/phase6.c
scrub/phase7.c

index e6c3e01811f6fa47c22c2ecabefb8d512658c57b..f21b24e0935c8f60ac3048cbb12964866e20b34f 100644 (file)
@@ -115,7 +115,7 @@ out_free:
 }
 
 /*
- * Estimate the number of blocks and inodes in the filesystem.  Returns 0
+ * Estimate the number of blocks and used inodes in the filesystem.  Returns 0
  * or a positive error number.
  */
 int
@@ -125,8 +125,7 @@ scrub_scan_estimate_blocks(
        unsigned long long              *d_bfree,
        unsigned long long              *r_blocks,
        unsigned long long              *r_bfree,
-       unsigned long long              *f_files,
-       unsigned long long              *f_free)
+       unsigned long long              *f_files_used)
 {
        struct xfs_fsop_counts          fc;
        int                             error;
@@ -140,8 +139,7 @@ scrub_scan_estimate_blocks(
        *d_bfree = fc.freedata;
        *r_blocks = ctx->mnt.fsgeom.rtblocks;
        *r_bfree = fc.freertx;
-       *f_files = fc.allocino;
-       *f_free = fc.freeino;
+       *f_files_used = fc.allocino - fc.freeino;
 
        return 0;
 }
index 1fae58a6b2875683c0cc21776090fe63015da617..13bd9967f004a4311647bd12a22fc769eeb4a2a2 100644 (file)
@@ -9,7 +9,7 @@
 int scrub_scan_estimate_blocks(struct scrub_ctx *ctx,
                unsigned long long *d_blocks, unsigned long long *d_bfree,
                unsigned long long *r_blocks, unsigned long long *r_bfree,
-               unsigned long long *f_files, unsigned long long *f_free);
+               unsigned long long *f_files_used);
 int scrub_count_all_inodes(struct scrub_ctx *ctx, uint64_t *count);
 
 #endif /* XFS_SCRUB_FSCOUNTERS_H_ */
index 8d976732d8e1befad86fd1275acc6af4b1382e8f..87828b60fbed90a1dfd9d681512672a774f83f6a 100644 (file)
@@ -719,12 +719,11 @@ phase6_estimate(
        unsigned long long      d_bfree;
        unsigned long long      r_blocks;
        unsigned long long      r_bfree;
-       unsigned long long      f_files;
-       unsigned long long      f_free;
+       unsigned long long      dontcare;
        int                     ret;
 
-       ret = scrub_scan_estimate_blocks(ctx, &d_blocks, &d_bfree,
-                               &r_blocks, &r_bfree, &f_files, &f_free);
+       ret = scrub_scan_estimate_blocks(ctx, &d_blocks, &d_bfree, &r_blocks,
+                       &r_bfree, &dontcare);
        if (ret) {
                str_liberror(ctx, ret, _("estimating verify work"));
                return ret;
index 96876f7c0596f0387d663dc2f805f2dbe6d87d95..bc652ab6f44aeb790602b4dcc8a3775b9f20ea49 100644 (file)
@@ -111,8 +111,6 @@ phase7_func(
        unsigned long long      d_bfree;
        unsigned long long      r_blocks;
        unsigned long long      r_bfree;
-       unsigned long long      f_files;
-       unsigned long long      f_free;
        bool                    complain;
        int                     ip;
        int                     error;
@@ -160,7 +158,7 @@ phase7_func(
        }
 
        error = scrub_scan_estimate_blocks(ctx, &d_blocks, &d_bfree, &r_blocks,
-                       &r_bfree, &f_files, &f_free);
+                       &r_bfree, &used_files);
        if (error) {
                str_liberror(ctx, error, _("estimating verify work"));
                return error;
@@ -177,7 +175,6 @@ phase7_func(
        /* Report on what we found. */
        used_data = cvt_off_fsb_to_b(&ctx->mnt, d_blocks - d_bfree);
        used_rt = cvt_off_fsb_to_b(&ctx->mnt, r_blocks - r_bfree);
-       used_files = f_files - f_free;
        stat_data = totalcount.dbytes;
        stat_rt = totalcount.rbytes;