diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-30 20:56:54 -0400 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-08 17:29:23 -0400 |
| commit | 3858aa4268b2f71827097f548879e4405b4cc995 (patch) | |
| tree | 16eac79ecd89e042a7b591c9b43bd4cf8905baf4 /fs/bcachefs/buckets.h | |
| parent | 302c980a818763d53dfa8fcd8549b04a5c7b8b17 (diff) | |
bcachefs: ptr_stale() -> dev_ptr_stale()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.h')
| -rw-r--r-- | fs/bcachefs/buckets.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h index 0a54faf7c50a..617ffde2fb7a 100644 --- a/fs/bcachefs/buckets.h +++ b/fs/bcachefs/buckets.h @@ -170,17 +170,19 @@ static inline int gen_after(u8 a, u8 b) return r > 0 ? r : 0; } +static inline u8 dev_ptr_stale_rcu(struct bch_dev *ca, const struct bch_extent_ptr *ptr) +{ + return gen_after(*bucket_gen(ca, PTR_BUCKET_NR(ca, ptr)), ptr->gen); +} + /** - * ptr_stale() - check if a pointer points into a bucket that has been + * dev_ptr_stale() - check if a pointer points into a bucket that has been * invalidated. */ -static inline u8 ptr_stale(struct bch_dev *ca, - const struct bch_extent_ptr *ptr) +static inline u8 dev_ptr_stale(struct bch_dev *ca, const struct bch_extent_ptr *ptr) { - u8 ret; - rcu_read_lock(); - ret = gen_after(*bucket_gen(ca, PTR_BUCKET_NR(ca, ptr)), ptr->gen); + u8 ret = dev_ptr_stale_rcu(ca, ptr); rcu_read_unlock(); return ret; |
