summaryrefslogtreecommitdiff
path: root/libbcachefs/alloc_background.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-04-17 02:08:10 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-04-17 02:08:19 -0400
commita0da3c91d439b402b0c11d44dd57158dfefbe84a (patch)
treeb26fbf6ace7d3ceb9cb09de4c99bc36110005dd0 /libbcachefs/alloc_background.h
parentc824bbe69db5d7ff5722033af1dcd01f41348206 (diff)
Update bcachefs sources to ff6fd3ef0cd0 bcachefs: Check for writing btree_ptr_v2.sectors_written == 0testing
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/alloc_background.h')
-rw-r--r--libbcachefs/alloc_background.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/libbcachefs/alloc_background.h b/libbcachefs/alloc_background.h
index 052b2fac..f9589a2c 100644
--- a/libbcachefs/alloc_background.h
+++ b/libbcachefs/alloc_background.h
@@ -17,12 +17,11 @@ static inline bool bch2_dev_bucket_exists(struct bch_fs *c, struct bpos pos)
{
struct bch_dev *ca;
- if (!bch2_dev_exists2(c, pos.inode))
+ if (!bch2_dev_exists(c, pos.inode))
return false;
- ca = bch_dev_bkey_exists(c, pos.inode);
- return pos.offset >= ca->mi.first_bucket &&
- pos.offset < ca->mi.nbuckets;
+ ca = bch2_dev_bkey_exists(c, pos.inode);
+ return bucket_valid(ca, pos.offset);
}
static inline u64 bucket_to_u64(struct bpos bucket)