summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_background.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-04-11 21:18:35 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-08 17:29:19 -0400
commitd155272b6e58a4b372982de777fde7dc503a8f96 (patch)
tree2e32624104d4a2ef2762406c01c2bc5402638bec /fs/bcachefs/alloc_background.h
parent923ed0ae5ebd0bb0dbc64a88348fa1835a3644ee (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.h3
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)