diff options
-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) |