diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-02-10 19:26:55 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:29 -0400 |
commit | 5735608c14e791c10ebcb6a20fab1c8fa4cf3123 (patch) | |
tree | 034f074d10d4d68c2bb84719fe0fa0b5507b3ee0 /fs/bcachefs/buckets.h | |
parent | 5f43f99c6ef74f592c380b39069ee68dcfe3ee58 (diff) | |
download | linux-stable-5735608c14e791c10ebcb6a20fab1c8fa4cf3123.tar.gz linux-stable-5735608c14e791c10ebcb6a20fab1c8fa4cf3123.tar.bz2 linux-stable-5735608c14e791c10ebcb6a20fab1c8fa4cf3123.zip |
bcachefs: Kill main in-memory bucket array
All code using the in-memory bucket array, excluding GC, has now been
converted to use the alloc btree directly - so we can finally delete it.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.h')
-rw-r--r-- | fs/bcachefs/buckets.h | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h index 9cc6c16bcc64..7ae1feadf4c0 100644 --- a/fs/bcachefs/buckets.h +++ b/fs/bcachefs/buckets.h @@ -30,34 +30,23 @@ _old; \ }) -static inline struct bucket_array *__bucket_array(struct bch_dev *ca, - bool gc) +static inline struct bucket_array *gc_bucket_array(struct bch_dev *ca) { - return rcu_dereference_check(ca->buckets[gc], + return rcu_dereference_check(ca->buckets_gc, !ca->fs || percpu_rwsem_is_held(&ca->fs->mark_lock) || lockdep_is_held(&ca->fs->gc_lock) || lockdep_is_held(&ca->bucket_lock)); } -static inline struct bucket_array *bucket_array(struct bch_dev *ca) -{ - return __bucket_array(ca, false); -} - -static inline struct bucket *__bucket(struct bch_dev *ca, size_t b, bool gc) +static inline struct bucket *gc_bucket(struct bch_dev *ca, size_t b) { - struct bucket_array *buckets = __bucket_array(ca, gc); + struct bucket_array *buckets = gc_bucket_array(ca); BUG_ON(b < buckets->first_bucket || b >= buckets->nbuckets); return buckets->b + b; } -static inline struct bucket *gc_bucket(struct bch_dev *ca, size_t b) -{ - return __bucket(ca, b, true); -} - static inline struct bucket_gens *bucket_gens(struct bch_dev *ca) { return rcu_dereference_check(ca->bucket_gens, @@ -65,7 +54,6 @@ static inline struct bucket_gens *bucket_gens(struct bch_dev *ca) percpu_rwsem_is_held(&ca->fs->mark_lock) || lockdep_is_held(&ca->fs->gc_lock) || lockdep_is_held(&ca->bucket_lock)); - } static inline u8 *bucket_gen(struct bch_dev *ca, size_t b) |