]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: client_quota no longer optional 14978/head
authorDan van der Ster <daniel.vanderster@cern.ch>
Fri, 5 May 2017 14:48:20 +0000 (16:48 +0200)
committerDan van der Ster <daniel.vanderster@cern.ch>
Fri, 5 May 2017 14:48:20 +0000 (16:48 +0200)
Remove the possibility to disable client quotas.

Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
src/client/Client.cc
src/common/config_opts.h

index 458467b851ad12d197b2e0861b9d9515520cdd65..1383e3b6c60f1a604b08d16a3db7bc05b6f06b5e 100644 (file)
@@ -9364,9 +9364,9 @@ int Client::statfs(const char *path, struct statvfs *stbuf,
   assert(root != nullptr);
   Inode *quota_root = root->quota.is_enable() ? root : get_quota_root(root, perms);
 
-  // get_quota_root should always give us something if client quotas are
-  // enabled
-  assert(cct->_conf->client_quota == false || quota_root != nullptr);
+  // get_quota_root should always give us something
+  // because client quotas are always enabled
+  assert(quota_root != nullptr);
 
   if (quota_root && cct->_conf->client_quota_df && quota_root->quota.max_bytes) {
 
@@ -11635,8 +11635,7 @@ int Client::_rename(Inode *fromdir, const char *fromname, Inode *todir, const ch
     else
       return -EROFS;
   }
-  if (cct->_conf->client_quota &&
-      fromdir != todir) {
+  if (fromdir != todir) {
     Inode *fromdir_root =
       fromdir->quota.is_enable() ? fromdir : get_quota_root(fromdir, perm);
     Inode *todir_root =
@@ -12844,9 +12843,6 @@ bool Client::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool
 
 Inode *Client::get_quota_root(Inode *in, const UserPerm& perms)
 {
-  if (!cct->_conf->client_quota)
-    return NULL;
-
   Inode *cur = in;
   utime_t now = ceph_clock_now();
 
@@ -12918,9 +12914,6 @@ Inode *Client::get_quota_root(Inode *in, const UserPerm& perms)
 bool Client::check_quota_condition(Inode *in, const UserPerm& perms,
                                   std::function<bool (const Inode &in)> test)
 {
-  if (!cct->_conf->client_quota)
-    return false;
-
   while (true) {
     assert(in != NULL);
     if (test(*in)) {
index 976f06418dc8a0df8b0211ecc37e8f2e4576c6b5..20ecaf78268ea81ffb78f0e2c48c86a4c7c309b6 100644 (file)
@@ -442,7 +442,6 @@ OPTION(client_mount_gid, OPT_INT, -1)
 OPTION(client_notify_timeout, OPT_INT, 10) // in seconds
 OPTION(osd_client_watch_timeout, OPT_INT, 30) // in seconds
 OPTION(client_caps_release_delay, OPT_INT, 5) // in seconds
-OPTION(client_quota, OPT_BOOL, true)
 OPTION(client_quota_df, OPT_BOOL, true) // use quota for df on subdir mounts
 OPTION(client_oc, OPT_BOOL, true)
 OPTION(client_oc_size, OPT_INT, 1024*1024* 200)    // MB * n