bcachefs: bch2_dev_bucket_exists() uses bch2_dev_rcu()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
ad897d241b
commit
78e9b548f3
|
@ -15,13 +15,11 @@ enum bkey_invalid_flags;
|
||||||
|
|
||||||
static inline bool bch2_dev_bucket_exists(struct bch_fs *c, struct bpos pos)
|
static inline bool bch2_dev_bucket_exists(struct bch_fs *c, struct bpos pos)
|
||||||
{
|
{
|
||||||
struct bch_dev *ca;
|
rcu_read_lock();
|
||||||
|
struct bch_dev *ca = bch2_dev_rcu(c, pos.inode);
|
||||||
if (!bch2_dev_exists(c, pos.inode))
|
bool ret = ca && bucket_valid(ca, pos.offset);
|
||||||
return false;
|
rcu_read_unlock();
|
||||||
|
return ret;
|
||||||
ca = bch2_dev_bkey_exists(c, pos.inode);
|
|
||||||
return bucket_valid(ca, pos.offset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline u64 bucket_to_u64(struct bpos bucket)
|
static inline u64 bucket_to_u64(struct bpos bucket)
|
||||||
|
|
Loading…
Reference in New Issue