Lines Matching refs:devs
32 static inline unsigned dev_mask_nr(const struct bch_devs_mask *devs) in dev_mask_nr() argument
34 return bitmap_weight(devs->d, BCH_SB_MEMBERS_MAX); in dev_mask_nr()
37 static inline bool bch2_dev_list_has_dev(struct bch_devs_list devs, in bch2_dev_list_has_dev() argument
40 darray_for_each(devs, i) in bch2_dev_list_has_dev()
46 static inline void bch2_dev_list_drop_dev(struct bch_devs_list *devs, in bch2_dev_list_drop_dev() argument
49 darray_for_each(*devs, i) in bch2_dev_list_drop_dev()
51 darray_remove_item(devs, i); in bch2_dev_list_drop_dev()
56 static inline void bch2_dev_list_add_dev(struct bch_devs_list *devs, in bch2_dev_list_add_dev() argument
59 if (!bch2_dev_list_has_dev(*devs, dev)) { in bch2_dev_list_add_dev()
60 BUG_ON(devs->nr >= ARRAY_SIZE(devs->data)); in bch2_dev_list_add_dev()
61 devs->data[devs->nr++] = dev; in bch2_dev_list_add_dev()
78 !(ca = rcu_dereference_check(c->devs[idx], in __bch2_next_dev_idx()
177 return dev < c->sb.nr_devices && c->devs[dev]; in bch2_dev_exists()
189 return rcu_dereference_check(c->devs[dev], 1); in bch2_dev_have_ref()
196 return rcu_dereference_protected(c->devs[dev], in bch2_dev_locked()
204 ? rcu_dereference(c->devs[dev]) in bch2_dev_rcu_noerror()
293 struct bch_devs_mask devs; in bch2_online_devs() local
295 memset(&devs, 0, sizeof(devs)); in bch2_online_devs()
297 __set_bit(ca->dev_idx, devs.d); in bch2_online_devs()
298 return devs; in bch2_online_devs()