diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-06-13 22:34:35 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-07-01 00:05:50 -0400 |
commit | 9b56a43f5d0ffab1ec73d047748ee7d65f274dfc (patch) | |
tree | 96c5358de4feea2fd3ccb0d8efddf821d7f4cc8d /fs | |
parent | 231110b24dbb5b11c361af0de9f46f627c393fd9 (diff) |
bcachefs: DEFINE_CLASS()es for dev refcounts
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/sb-members.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/bcachefs/sb-members.h b/fs/bcachefs/sb-members.h index 8d8a8a857648..5dcc2017f85b 100644 --- a/fs/bcachefs/sb-members.h +++ b/fs/bcachefs/sb-members.h @@ -240,6 +240,10 @@ static inline struct bch_dev *bch2_dev_tryget_noerror(struct bch_fs *c, unsigned return ca; } +DEFINE_CLASS(bch2_dev_tryget_noerror, struct bch_dev *, + bch2_dev_put(_T), bch2_dev_tryget_noerror(c, dev), + struct bch_fs *c, unsigned dev); + static inline struct bch_dev *bch2_dev_tryget(struct bch_fs *c, unsigned dev) { struct bch_dev *ca = bch2_dev_tryget_noerror(c, dev); @@ -248,6 +252,10 @@ static inline struct bch_dev *bch2_dev_tryget(struct bch_fs *c, unsigned dev) return ca; } +DEFINE_CLASS(bch2_dev_tryget, struct bch_dev *, + bch2_dev_put(_T), bch2_dev_tryget(c, dev), + struct bch_fs *c, unsigned dev); + static inline struct bch_dev *bch2_dev_bucket_tryget_noerror(struct bch_fs *c, struct bpos bucket) { struct bch_dev *ca = bch2_dev_tryget_noerror(c, bucket.inode); @@ -258,6 +266,10 @@ static inline struct bch_dev *bch2_dev_bucket_tryget_noerror(struct bch_fs *c, s return ca; } +DEFINE_CLASS(bch2_dev_bucket_tryget_noerror, struct bch_dev *, + bch2_dev_put(_T), bch2_dev_bucket_tryget_noerror(c, bucket), + struct bch_fs *c, struct bpos bucket); + void bch2_dev_bucket_missing(struct bch_dev *, u64); static inline struct bch_dev *bch2_dev_bucket_tryget(struct bch_fs *c, struct bpos bucket) @@ -271,6 +283,10 @@ static inline struct bch_dev *bch2_dev_bucket_tryget(struct bch_fs *c, struct bp return ca; } +DEFINE_CLASS(bch2_dev_bucket_tryget, struct bch_dev *, + bch2_dev_put(_T), bch2_dev_bucket_tryget(c, bucket), + struct bch_fs *c, struct bpos bucket); + static inline struct bch_dev *bch2_dev_iterate_noerror(struct bch_fs *c, struct bch_dev *ca, unsigned dev_idx) { if (ca && ca->dev_idx == dev_idx) |