Merge pull request #14978 from cernceph/dvanders_quota

client: client_quota no longer optional

Reviewed-by: John Spray <john.spray@redhat.com>
This commit is contained in:
John Spray 2017-05-15 13:16:09 +01:00 committed by GitHub
commit 0f250a889d
2 changed files with 4 additions and 12 deletions

View File

@ -9336,9 +9336,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) {
@ -11607,8 +11607,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 =
@ -12816,9 +12815,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();
@ -12890,9 +12886,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)) {

View File

@ -443,7 +443,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