diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-10-22 13:25:25 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2022-10-22 14:41:54 -0400 |
commit | 188b6d0c8ef1c02462a744b176557c27220112c9 (patch) | |
tree | ab1f239b3bad0335e1d3fa62415bc8d845ba68be /libbcachefs/sysfs.c | |
parent | 494421ee6e85514f90bb316d77e1dd4f7dad3420 (diff) |
Update bcachefs sources to cd779e0cc5 bcachefs: Skip inode unpack/pack in bch2_extent_update()
Diffstat (limited to 'libbcachefs/sysfs.c')
-rw-r--r-- | libbcachefs/sysfs.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libbcachefs/sysfs.c b/libbcachefs/sysfs.c index 103fde9..0f45aef 100644 --- a/libbcachefs/sysfs.c +++ b/libbcachefs/sysfs.c @@ -175,7 +175,7 @@ read_attribute(minor); read_attribute(bucket_size); read_attribute(first_bucket); read_attribute(nbuckets); -read_attribute(durability); +rw_attribute(durability); read_attribute(iodone); read_attribute(io_latency_read); @@ -425,7 +425,7 @@ SHOW(bch2_fs) bch2_btree_updates_to_text(out, c); if (attr == &sysfs_btree_cache) - bch2_btree_cache_to_text(out, c); + bch2_btree_cache_to_text(out, &c->btree_cache); if (attr == &sysfs_btree_key_cache) bch2_btree_key_cache_to_text(out, &c->btree_key_cache); @@ -907,6 +907,19 @@ STORE(bch2_dev) mutex_unlock(&c->sb_lock); } + if (attr == &sysfs_durability) { + u64 v = strtoul_or_return(buf); + + mutex_lock(&c->sb_lock); + mi = &bch2_sb_get_members(c->disk_sb.sb)->members[ca->dev_idx]; + + if (v != BCH_MEMBER_DURABILITY(mi)) { + SET_BCH_MEMBER_DURABILITY(mi, v + 1); + bch2_write_super(c); + } + mutex_unlock(&c->sb_lock); + } + if (attr == &sysfs_label) { char *tmp; int ret; |