Commit 3d080aa5 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Delete unused arguments

Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 4fe7efa1
...@@ -45,7 +45,7 @@ static void pd_controllers_update(struct work_struct *work) ...@@ -45,7 +45,7 @@ static void pd_controllers_update(struct work_struct *work)
unsigned i; unsigned i;
for_each_member_device(ca, c, 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, free += bucket_to_sector(ca,
__dev_buckets_free(ca, stats)) << 9; __dev_buckets_free(ca, stats)) << 9;
...@@ -514,7 +514,7 @@ static int wait_buckets_available(struct bch_fs *c, struct bch_dev *ca) ...@@ -514,7 +514,7 @@ static int wait_buckets_available(struct bch_fs *c, struct bch_dev *ca)
if (gc_count != c->gc_count) if (gc_count != c->gc_count)
ca->inc_gen_really_needs_gc = 0; 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); ca->inc_gen_really_needs_gc);
if (available > fifo_free(&ca->free_inc) || if (available > fifo_free(&ca->free_inc) ||
......
...@@ -347,11 +347,11 @@ struct dev_alloc_list bch2_dev_alloc_list(struct bch_fs *c, ...@@ -347,11 +347,11 @@ struct dev_alloc_list bch2_dev_alloc_list(struct bch_fs *c,
return ret; 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) struct dev_stripe_state *stripe)
{ {
u64 *v = stripe->next_alloc + ca->dev_idx; 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 u64 free_space_inv = free_space
? div64_u64(1ULL << 48, free_space) ? div64_u64(1ULL << 48, free_space)
: 1ULL << 48; : 1ULL << 48;
...@@ -432,7 +432,7 @@ bch2_bucket_alloc_set(struct bch_fs *c, ...@@ -432,7 +432,7 @@ bch2_bucket_alloc_set(struct bch_fs *c,
add_new_bucket(c, ptrs, devs_may_alloc, add_new_bucket(c, ptrs, devs_may_alloc,
nr_effective, have_cache, flags, ob); nr_effective, have_cache, flags, ob);
bch2_dev_stripe_increment(c, ca, stripe); bch2_dev_stripe_increment(ca, stripe);
if (*nr_effective >= nr_replicas) if (*nr_effective >= nr_replicas)
return ALLOC_SUCCESS; return ALLOC_SUCCESS;
......
...@@ -27,8 +27,7 @@ struct dev_alloc_list { ...@@ -27,8 +27,7 @@ struct dev_alloc_list {
struct dev_alloc_list bch2_dev_alloc_list(struct bch_fs *, struct dev_alloc_list bch2_dev_alloc_list(struct bch_fs *,
struct dev_stripe_state *, struct dev_stripe_state *,
struct bch_devs_mask *); struct bch_devs_mask *);
void bch2_dev_stripe_increment(struct bch_fs *, struct bch_dev *, void bch2_dev_stripe_increment(struct bch_dev *, struct dev_stripe_state *);
struct dev_stripe_state *);
long bch2_bucket_alloc_new_fs(struct bch_dev *); long bch2_bucket_alloc_new_fs(struct bch_dev *);
......
...@@ -179,7 +179,7 @@ struct bch_fs_usage_online *bch2_fs_usage_scratch_get(struct bch_fs *c) ...@@ -179,7 +179,7 @@ struct bch_fs_usage_online *bch2_fs_usage_scratch_get(struct bch_fs *c)
return ret; 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; struct bch_dev_usage ret;
......
...@@ -182,7 +182,7 @@ static inline bool bucket_needs_journal_commit(struct bucket_mark m, ...@@ -182,7 +182,7 @@ static inline bool bucket_needs_journal_commit(struct bucket_mark m,
/* Device usage: */ /* 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 *); void bch2_dev_usage_from_buckets(struct bch_fs *);
...@@ -202,9 +202,9 @@ static inline u64 __dev_buckets_available(struct bch_dev *ca, ...@@ -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: * 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, static inline u64 __dev_buckets_free(struct bch_dev *ca,
...@@ -215,9 +215,9 @@ 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); 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: */ /* Filesystem usage: */
......
...@@ -468,7 +468,7 @@ static long bch2_ioctl_dev_usage(struct bch_fs *c, ...@@ -468,7 +468,7 @@ static long bch2_ioctl_dev_usage(struct bch_fs *c,
if (IS_ERR(ca)) if (IS_ERR(ca))
return PTR_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.state = ca->mi.state;
arg.bucket_size = ca->mi.bucket_size; arg.bucket_size = ca->mi.bucket_size;
......
...@@ -759,7 +759,7 @@ static void __journal_write_alloc(struct journal *j, ...@@ -759,7 +759,7 @@ static void __journal_write_alloc(struct journal *j,
sectors > ja->sectors_free) sectors > ja->sectors_free)
continue; continue;
bch2_dev_stripe_increment(c, ca, &j->wp.stripe); bch2_dev_stripe_increment(ca, &j->wp.stripe);
bch2_bkey_append_ptr(&w->key, bch2_bkey_append_ptr(&w->key,
(struct bch_extent_ptr) { (struct bch_extent_ptr) {
......
...@@ -261,7 +261,7 @@ unsigned long bch2_copygc_wait_amount(struct bch_fs *c) ...@@ -261,7 +261,7 @@ unsigned long bch2_copygc_wait_amount(struct bch_fs *c)
u64 fragmented = 0; u64 fragmented = 0;
for_each_rw_member(ca, c, dev_idx) { 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) * fragmented_allowed += ((__dev_buckets_available(ca, usage) *
ca->mi.bucket_size) >> 1); ca->mi.bucket_size) >> 1);
......
...@@ -826,7 +826,7 @@ static ssize_t show_reserve_stats(struct bch_dev *ca, char *buf) ...@@ -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) static ssize_t show_dev_alloc_debug(struct bch_dev *ca, char *buf)
{ {
struct bch_fs *c = ca->fs; 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]; unsigned i, nr[BCH_DATA_NR];
memset(nr, 0, sizeof(nr)); memset(nr, 0, sizeof(nr));
...@@ -874,7 +874,7 @@ static ssize_t show_dev_alloc_debug(struct bch_dev *ca, char *buf) ...@@ -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_user],
stats.buckets[BCH_DATA_cached], stats.buckets[BCH_DATA_cached],
stats.buckets_ec, 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_sb],
stats.sectors[BCH_DATA_journal], stats.sectors[BCH_DATA_journal],
stats.sectors[BCH_DATA_btree], stats.sectors[BCH_DATA_btree],
......
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