diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2017-06-13 17:06:05 -0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-06-13 17:41:59 -0800 |
commit | 38f22164a9a3f2f8e33af8e0cc3ce4f17ef99cde (patch) | |
tree | 3b5de0fc73f51199bea8fcb63ad97a5b01a7c4ca /libbcachefs/super.h | |
parent | 914c4d19ed4a1c64268c4c23609c43d3d6765969 (diff) |
Update bcachefs sources to 6a25f7a00d bcachefs: fix ioctl code
Diffstat (limited to 'libbcachefs/super.h')
-rw-r--r-- | libbcachefs/super.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libbcachefs/super.h b/libbcachefs/super.h index e4bb583f..54f60c62 100644 --- a/libbcachefs/super.h +++ b/libbcachefs/super.h @@ -94,6 +94,18 @@ static inline struct bch_dev *bch2_get_next_online_dev(struct bch_fs *c, __for_each_online_member(ca, c, iter, \ (1 << BCH_MEMBER_STATE_RW)|(1 << BCH_MEMBER_STATE_RO)) +static inline struct bch_devs_mask bch2_online_devs(struct bch_fs *c) +{ + struct bch_devs_mask devs; + struct bch_dev *ca; + unsigned i; + + memset(&devs, 0, sizeof(devs)); + for_each_online_member(ca, c, i) + __set_bit(ca->dev_idx, devs.d); + return devs; +} + struct bch_fs *bch2_bdev_to_fs(struct block_device *); struct bch_fs *bch2_uuid_to_fs(uuid_le); int bch2_congested(struct bch_fs *, int); |