summaryrefslogtreecommitdiff
path: root/libbcachefs/super-io.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-03-13 03:22:35 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2018-03-13 03:22:35 -0400
commit35d3f92ad57eae226e255817131fa02605aac1b5 (patch)
tree6efc540cc3ecab2a44bd7c1775829edb97f4de13 /libbcachefs/super-io.h
parent2bb8cdfc75474cf11f9a9587ab9b15d009e48fc9 (diff)
Update bcachefs sources to f7ccf51390 bcachefs: durability
Diffstat (limited to 'libbcachefs/super-io.h')
-rw-r--r--libbcachefs/super-io.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libbcachefs/super-io.h b/libbcachefs/super-io.h
index 2fa0719f..2514ac8a 100644
--- a/libbcachefs/super-io.h
+++ b/libbcachefs/super-io.h
@@ -132,6 +132,9 @@ static inline struct bch_member_cpu bch2_mi_to_cpu(struct bch_member *mi)
.replacement = BCH_MEMBER_REPLACEMENT(mi),
.discard = BCH_MEMBER_DISCARD(mi),
.data_allowed = BCH_MEMBER_DATA_ALLOWED(mi),
+ .durability = BCH_MEMBER_DURABILITY(mi)
+ ? BCH_MEMBER_DURABILITY(mi) - 1
+ : 1,
.valid = !bch2_is_zero(mi->uuid.b, sizeof(uuid_le)),
};
}
@@ -249,6 +252,17 @@ static inline bool dev_in_target(struct bch_dev *ca, unsigned target)
}
}
+static inline bool dev_idx_in_target(struct bch_fs *c, unsigned dev, unsigned target)
+{
+ bool ret;
+
+ rcu_read_lock();
+ ret = dev_in_target(rcu_dereference(c->devs[dev]), target);
+ rcu_read_unlock();
+
+ return ret;
+}
+
const struct bch_devs_mask *bch2_target_to_mask(struct bch_fs *, unsigned);
int __bch2_disk_group_find(struct bch_sb_field_disk_groups *, const char *);