bcachefs: Delete unused arguments
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 22 Jul 2020 17:27:00 +0000 (13:27 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:43 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.c
fs/bcachefs/alloc_foreground.c
fs/bcachefs/alloc_foreground.h
fs/bcachefs/buckets.c
fs/bcachefs/buckets.h
fs/bcachefs/chardev.c
fs/bcachefs/journal_io.c
fs/bcachefs/movinggc.c
fs/bcachefs/sysfs.c

index d80e1edf8c440527598066054333a76d2ba6a090..54455f77ad2a4140041c157e50a26fb9b588141f 100644 (file)
@@ -45,7 +45,7 @@ static void pd_controllers_update(struct work_struct *work)
        unsigned i;
 
        for_each_member_device(ca, c, i) {
-               struct bch_dev_usage stats = bch2_dev_usage_read(c, ca);
+               struct bch_dev_usage stats = bch2_dev_usage_read(ca);
 
                free += bucket_to_sector(ca,
                                __dev_buckets_free(ca, stats)) << 9;
@@ -514,7 +514,7 @@ static int wait_buckets_available(struct bch_fs *c, struct bch_dev *ca)
                if (gc_count != c->gc_count)
                        ca->inc_gen_really_needs_gc = 0;
 
-               available = max_t(s64, 0, dev_buckets_available(c, ca) -
+               available = max_t(s64, 0, dev_buckets_available(ca) -
                                  ca->inc_gen_really_needs_gc);
 
                if (available > fifo_free(&ca->free_inc) ||
index 747e86d5cd97fe09f958f46af188715351e31213..2dc8a8ff0569efdda3a13dbcba366266ea8bc1ec 100644 (file)
@@ -347,11 +347,11 @@ struct dev_alloc_list bch2_dev_alloc_list(struct bch_fs *c,
        return ret;
 }
 
-void bch2_dev_stripe_increment(struct bch_fs *c, struct bch_dev *ca,
+void bch2_dev_stripe_increment(struct bch_dev *ca,
                               struct dev_stripe_state *stripe)
 {
        u64 *v = stripe->next_alloc + ca->dev_idx;
-       u64 free_space = dev_buckets_free(c, ca);
+       u64 free_space = dev_buckets_free(ca);
        u64 free_space_inv = free_space
                ? div64_u64(1ULL << 48, free_space)
                : 1ULL << 48;
@@ -432,7 +432,7 @@ bch2_bucket_alloc_set(struct bch_fs *c,
                add_new_bucket(c, ptrs, devs_may_alloc,
                               nr_effective, have_cache, flags, ob);
 
-               bch2_dev_stripe_increment(c, ca, stripe);
+               bch2_dev_stripe_increment(ca, stripe);
 
                if (*nr_effective >= nr_replicas)
                        return ALLOC_SUCCESS;
index e8357ec0b333080968ce490ce988285bc9142228..dc8574a1a76a29c14daddfd24049e098d598e565 100644 (file)
@@ -27,8 +27,7 @@ struct dev_alloc_list {
 struct dev_alloc_list bch2_dev_alloc_list(struct bch_fs *,
                                          struct dev_stripe_state *,
                                          struct bch_devs_mask *);
-void bch2_dev_stripe_increment(struct bch_fs *, struct bch_dev *,
-                              struct dev_stripe_state *);
+void bch2_dev_stripe_increment(struct bch_dev *, struct dev_stripe_state *);
 
 long bch2_bucket_alloc_new_fs(struct bch_dev *);
 
index c8a57b512b77295a59ff4bddc3823cb0d0a38f08..7aba1907f91daa2604d2d6803e1ab5059623caef 100644 (file)
@@ -179,7 +179,7 @@ out_pool:
        return ret;
 }
 
-struct bch_dev_usage bch2_dev_usage_read(struct bch_fs *c, struct bch_dev *ca)
+struct bch_dev_usage bch2_dev_usage_read(struct bch_dev *ca)
 {
        struct bch_dev_usage ret;
 
index 44a5b6df8c8b8d89070272ead825f61e6495c39e..c85015071c6d8c0594e8a49c1b15bd86fbf07717 100644 (file)
@@ -182,7 +182,7 @@ static inline bool bucket_needs_journal_commit(struct bucket_mark m,
 
 /* Device usage: */
 
-struct bch_dev_usage bch2_dev_usage_read(struct bch_fs *, struct bch_dev *);
+struct bch_dev_usage bch2_dev_usage_read(struct bch_dev *);
 
 void bch2_dev_usage_from_buckets(struct bch_fs *);
 
@@ -202,9 +202,9 @@ static inline u64 __dev_buckets_available(struct bch_dev *ca,
 /*
  * Number of reclaimable buckets - only for use by the allocator thread:
  */
-static inline u64 dev_buckets_available(struct bch_fs *c, struct bch_dev *ca)
+static inline u64 dev_buckets_available(struct bch_dev *ca)
 {
-       return __dev_buckets_available(ca, bch2_dev_usage_read(c, ca));
+       return __dev_buckets_available(ca, bch2_dev_usage_read(ca));
 }
 
 static inline u64 __dev_buckets_free(struct bch_dev *ca,
@@ -215,9 +215,9 @@ static inline u64 __dev_buckets_free(struct bch_dev *ca,
                fifo_used(&ca->free_inc);
 }
 
-static inline u64 dev_buckets_free(struct bch_fs *c, struct bch_dev *ca)
+static inline u64 dev_buckets_free(struct bch_dev *ca)
 {
-       return __dev_buckets_free(ca, bch2_dev_usage_read(c, ca));
+       return __dev_buckets_free(ca, bch2_dev_usage_read(ca));
 }
 
 /* Filesystem usage: */
index b46d32db4b581590b8c22a03623a8f70663f2dad..0b1eca63f78e229dd5217fdc3a6bb8efb81e1d19 100644 (file)
@@ -468,7 +468,7 @@ static long bch2_ioctl_dev_usage(struct bch_fs *c,
        if (IS_ERR(ca))
                return PTR_ERR(ca);
 
-       src = bch2_dev_usage_read(c, ca);
+       src = bch2_dev_usage_read(ca);
 
        arg.state               = ca->mi.state;
        arg.bucket_size         = ca->mi.bucket_size;
index b43f69c19b0f43a8e996a63b616fa355ea6e927d..9df8dd75f4ec6eb0633b78e3996ffeb0c7980c36 100644 (file)
@@ -759,7 +759,7 @@ static void __journal_write_alloc(struct journal *j,
                    sectors > ja->sectors_free)
                        continue;
 
-               bch2_dev_stripe_increment(c, ca, &j->wp.stripe);
+               bch2_dev_stripe_increment(ca, &j->wp.stripe);
 
                bch2_bkey_append_ptr(&w->key,
                        (struct bch_extent_ptr) {
index 3c87e4b8da334852c3e3e97c995acc0da79fb7c5..44360bf03d297491c948a7eb790f442895b7fbca 100644 (file)
@@ -261,7 +261,7 @@ unsigned long bch2_copygc_wait_amount(struct bch_fs *c)
        u64 fragmented = 0;
 
        for_each_rw_member(ca, c, dev_idx) {
-               struct bch_dev_usage usage = bch2_dev_usage_read(c, ca);
+               struct bch_dev_usage usage = bch2_dev_usage_read(ca);
 
                fragmented_allowed += ((__dev_buckets_available(ca, usage) *
                                        ca->mi.bucket_size) >> 1);
index 058e2137f0c939b8930458df1d4143dc8357f687..911c305d372c2c7166ab9835012dd83fc6007450 100644 (file)
@@ -826,7 +826,7 @@ static ssize_t show_reserve_stats(struct bch_dev *ca, char *buf)
 static ssize_t show_dev_alloc_debug(struct bch_dev *ca, char *buf)
 {
        struct bch_fs *c = ca->fs;
-       struct bch_dev_usage stats = bch2_dev_usage_read(c, ca);
+       struct bch_dev_usage stats = bch2_dev_usage_read(ca);
        unsigned i, nr[BCH_DATA_NR];
 
        memset(nr, 0, sizeof(nr));
@@ -874,7 +874,7 @@ static ssize_t show_dev_alloc_debug(struct bch_dev *ca, char *buf)
                stats.buckets[BCH_DATA_user],
                stats.buckets[BCH_DATA_cached],
                stats.buckets_ec,
-               ca->mi.nbuckets - ca->mi.first_bucket - stats.buckets_unavailable,
+               __dev_buckets_available(ca, stats),
                stats.sectors[BCH_DATA_sb],
                stats.sectors[BCH_DATA_journal],
                stats.sectors[BCH_DATA_btree],