diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-11 21:18:35 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-08 17:29:19 -0400 |
commit | d155272b6e58a4b372982de777fde7dc503a8f96 (patch) | |
tree | 2e32624104d4a2ef2762406c01c2bc5402638bec /fs/bcachefs/alloc_background.h | |
parent | 923ed0ae5ebd0bb0dbc64a88348fa1835a3644ee (diff) |
bcachefs: bucket_valid()
cut out a branch from doing it the obvious way
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_background.h')
-rw-r--r-- | fs/bcachefs/alloc_background.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/bcachefs/alloc_background.h b/fs/bcachefs/alloc_background.h index 2790e516383d..2bcc648081c3 100644 --- a/fs/bcachefs/alloc_background.h +++ b/fs/bcachefs/alloc_background.h @@ -21,8 +21,7 @@ static inline bool bch2_dev_bucket_exists(struct bch_fs *c, struct bpos pos) return false; ca = bch_dev_bkey_exists(c, pos.inode); - return pos.offset >= ca->mi.first_bucket && - pos.offset < ca->mi.nbuckets; + return bucket_valid(ca, pos.offset); } static inline u64 bucket_to_u64(struct bpos bucket) |