Lines Matching refs:dev

29 static inline bool bch2_dev_idx_is_online(struct bch_fs *c, unsigned dev)  in bch2_dev_idx_is_online()  argument
32 struct bch_dev *ca = bch2_dev_rcu(c, dev); in bch2_dev_idx_is_online()
48 unsigned dev) in bch2_dev_list_has_dev() argument
51 if (*i == dev) in bch2_dev_list_has_dev()
57 unsigned dev) in bch2_dev_list_drop_dev() argument
60 if (*i == dev) { in bch2_dev_list_drop_dev()
67 unsigned dev) in bch2_dev_list_add_dev() argument
69 if (!bch2_dev_list_has_dev(*devs, dev)) { in bch2_dev_list_add_dev()
71 devs->data[devs->nr++] = dev; in bch2_dev_list_add_dev()
75 static inline struct bch_devs_list bch2_dev_list_single(unsigned dev) in bch2_dev_list_single() argument
77 return (struct bch_devs_list) { .nr = 1, .data[0] = dev }; in bch2_dev_list_single()
189 static inline bool bch2_dev_exists(const struct bch_fs *c, unsigned dev) in bch2_dev_exists() argument
191 return dev < c->sb.nr_devices && c->devs[dev]; in bch2_dev_exists()
199 static inline struct bch_dev *bch2_dev_have_ref(const struct bch_fs *c, unsigned dev) in bch2_dev_have_ref() argument
201 EBUG_ON(!bch2_dev_exists(c, dev)); in bch2_dev_have_ref()
203 return rcu_dereference_check(c->devs[dev], 1); in bch2_dev_have_ref()
206 static inline struct bch_dev *bch2_dev_locked(struct bch_fs *c, unsigned dev) in bch2_dev_locked() argument
208 EBUG_ON(!bch2_dev_exists(c, dev)); in bch2_dev_locked()
210 return rcu_dereference_protected(c->devs[dev], in bch2_dev_locked()
215 static inline struct bch_dev *bch2_dev_rcu_noerror(struct bch_fs *c, unsigned dev) in bch2_dev_rcu_noerror() argument
217 return c && dev < c->sb.nr_devices in bch2_dev_rcu_noerror()
218 ? rcu_dereference(c->devs[dev]) in bch2_dev_rcu_noerror()
226 static inline struct bch_dev *bch2_dev_rcu(struct bch_fs *c, unsigned dev) in bch2_dev_rcu() argument
228 struct bch_dev *ca = bch2_dev_rcu_noerror(c, dev); in bch2_dev_rcu()
230 bch2_dev_missing_atomic(c, dev); in bch2_dev_rcu()
234 static inline struct bch_dev *bch2_dev_tryget_noerror(struct bch_fs *c, unsigned dev) in bch2_dev_tryget_noerror() argument
237 struct bch_dev *ca = bch2_dev_rcu_noerror(c, dev); in bch2_dev_tryget_noerror()
243 static inline struct bch_dev *bch2_dev_tryget(struct bch_fs *c, unsigned dev) in bch2_dev_tryget() argument
245 struct bch_dev *ca = bch2_dev_tryget_noerror(c, dev); in bch2_dev_tryget()
247 bch2_dev_missing_atomic(c, dev); in bch2_dev_tryget()
290 static inline struct bch_dev *bch2_dev_get_ioref(struct bch_fs *c, unsigned dev, in bch2_dev_get_ioref() argument
296 struct bch_dev *ca = bch2_dev_rcu(c, dev); in bch2_dev_get_ioref()
317 static inline bool bch2_member_exists(struct bch_sb *sb, unsigned dev) in bch2_member_exists() argument
319 if (dev < sb->nr_devices) { in bch2_member_exists()
320 struct bch_member m = bch2_sb_member_get(sb, dev); in bch2_member_exists()