diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-23 16:45:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-23 16:45:13 +0000 |
commit | 389020e14594e4894e28d1eb9103c210b142509e (patch) | |
tree | 2ba734cdd7a243f46dda7c3d0cc88c2293d9699f /src/mon/FSCommands.cc | |
parent | Adding upstream version 18.2.2. (diff) | |
download | ceph-389020e14594e4894e28d1eb9103c210b142509e.tar.xz ceph-389020e14594e4894e28d1eb9103c210b142509e.zip |
Adding upstream version 18.2.3.upstream/18.2.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/mon/FSCommands.cc')
-rw-r--r-- | src/mon/FSCommands.cc | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/mon/FSCommands.cc b/src/mon/FSCommands.cc index 65d2c356b..05d28cc4c 100644 --- a/src/mon/FSCommands.cc +++ b/src/mon/FSCommands.cc @@ -461,6 +461,17 @@ public: { fs->mds_map.set_max_filesize(n); }); + } else if (var == "max_xattr_size") { + if (interr.length()) { + ss << var << " requires an integer value"; + return -EINVAL; + } + fsmap.modify_filesystem( + fs->fscid, + [n](std::shared_ptr<Filesystem> fs) + { + fs->mds_map.set_max_xattr_size(n); + }); } else if (var == "allow_new_snaps") { bool enable_snaps = false; int r = parse_bool(val, &enable_snaps, ss); @@ -667,6 +678,21 @@ public: } }; fsmap.modify_filesystem(fs->fscid, std::move(f)); + } else if (var == "balance_automate") { + bool allow = false; + int r = parse_bool(val, &allow, ss); + if (r != 0) { + return r; + } + + auto f = [allow](auto&& fs) { + if (allow) { + fs->mds_map.set_balance_automate(); + } else { + fs->mds_map.clear_balance_automate(); + } + }; + fsmap.modify_filesystem(fs->fscid, std::move(f)); } else if (var == "min_compat_client") { auto vno = ceph_release_from_name(val.c_str()); if (!vno) { @@ -713,6 +739,38 @@ public: ss << "client(s) already allowed to establish new session(s)"; } } + } else if (var == "refuse_standby_for_another_fs") { + bool refuse_standby_for_another_fs = false; + int r = parse_bool(val, &refuse_standby_for_another_fs, ss); + if (r != 0) { + return r; + } + + if (refuse_standby_for_another_fs) { + if (!(fs->mds_map.test_flag(CEPH_MDSMAP_REFUSE_STANDBY_FOR_ANOTHER_FS))) { + fsmap.modify_filesystem( + fs->fscid, + [](std::shared_ptr<Filesystem> fs) + { + fs->mds_map.set_flag(CEPH_MDSMAP_REFUSE_STANDBY_FOR_ANOTHER_FS); + }); + ss << "set to refuse standby for another fs"; + } else { + ss << "to refuse standby for another fs is already set"; + } + } else { + if (fs->mds_map.test_flag(CEPH_MDSMAP_REFUSE_STANDBY_FOR_ANOTHER_FS)) { + fsmap.modify_filesystem( + fs->fscid, + [](std::shared_ptr<Filesystem> fs) + { + fs->mds_map.clear_flag(CEPH_MDSMAP_REFUSE_STANDBY_FOR_ANOTHER_FS); + }); + ss << "allowed to use standby for another fs"; + } else { + ss << "to use standby for another fs is already allowed"; + } + } } else { ss << "unknown variable " << var; return -EINVAL; |