]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add mds_fscrypt_last_block_max_size option support
authorXiubo Li <xiubli@redhat.com>
Thu, 25 Nov 2021 00:52:37 +0000 (08:52 +0800)
committerXiubo Li <xiubli@redhat.com>
Thu, 13 Jan 2022 14:01:39 +0000 (22:01 +0800)
The maximum size of the last block without the header along with
a truncate request when the fscrypt is enabled. Default value is
4KB.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/common/options/mds.yaml.in
src/mds/Server.cc
src/mds/Server.h

index cfe678ed464d51d03c630b3ff9cbe23c8f92d528..4d12d5aad8ab65391bba2aeb56c698f6374c9ff7 100644 (file)
@@ -11,6 +11,16 @@ options:
   - mds
   flags:
   - runtime
+- name: mds_fscrypt_last_block_max_size
+  type: size
+  level: advanced
+  desc: maximum size of the last block without the header along with a truncate
+    request when the fscrypt is enabled.
+  default: 4_K
+  services:
+  - mds
+  flags:
+  - runtime
 - name: mds_valgrind_exit
   type: bool
   level: dev
index 31d8f216b7fcac022e92668c0931e4cca79afc6b..628241d754da9508d40b787c4cc9f2cbaaa47987 100644 (file)
@@ -1259,6 +1259,9 @@ void Server::handle_conf_change(const std::set<std::string>& changed) {
   if (changed.count("mds_alternate_name_max")) {
     alternate_name_max  = g_conf().get_val<Option::size_t>("mds_alternate_name_max");
   }
+  if (changed.count("mds_fscrypt_last_block_max_size")) {
+    fscrypt_last_block_max_size = g_conf().get_val<Option::size_t>("mds_fscrypt_last_block_max_size");
+  }
   if (changed.count("mds_dir_max_entries")) {
     dir_max_entries = g_conf().get_val<uint64_t>("mds_dir_max_entries");
     dout(20) << __func__ << " max entries per directory changed to "
index 76f38717c7265b29ce783816eff3abb8afc65bb8..13e3d66d14c737bf61b45d09312aa781d4af2a53 100644 (file)
@@ -475,6 +475,7 @@ private:
   double caps_throttle_retry_request_timeout;
 
   size_t alternate_name_max = g_conf().get_val<Option::size_t>("mds_alternate_name_max");
+  size_t fscrypt_last_block_max_size = g_conf().get_val<Option::size_t>("mds_fscrypt_last_block_max_size");
 };
 
 static inline constexpr auto operator|(Server::RecallFlags a, Server::RecallFlags b) {