From: Xiubo Li Date: Fri, 1 Jul 2022 08:05:36 +0000 (+0800) Subject: types.h: fix typo by renaming quota.is_enable() to quota.is_enabled() X-Git-Tag: v18.0.0~164^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ac372cd7c7c64637592d2999de2e98fc68a9029e;p=ceph.git types.h: fix typo by renaming quota.is_enable() to quota.is_enabled() Signed-off-by: Xiubo Li --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 24318e601c89..7c0562554ed8 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -11214,7 +11214,7 @@ int Client::statfs(const char *path, struct statvfs *stbuf, // quota but we can see a parent of it that does have a quota, we'll // respect that one instead. ceph_assert(root != nullptr); - InodeRef quota_root = root->quota.is_enable(QUOTA_MAX_BYTES) ? root : get_quota_root(root.get(), perms, QUOTA_MAX_BYTES); + InodeRef quota_root = root->quota.is_enabled(QUOTA_MAX_BYTES) ? root : get_quota_root(root.get(), perms, QUOTA_MAX_BYTES); // get_quota_root should always give us something if client quotas are // enabled @@ -12838,7 +12838,7 @@ int Client::_setxattr(Inode *in, const char *name, const void *value, int ret = _do_setxattr(in, name, value, size, flags, perms); if (ret >= 0 && check_realm) { // check if snaprealm was created for quota inode - if (in->quota.is_enable() && + if (in->quota.is_enabled() && !(in->snaprealm && in->snaprealm->ino == in->ino)) ret = -CEPHFS_EOPNOTSUPP; } @@ -13067,7 +13067,7 @@ int Client::_vxattrcb_fscrypt_file_set(Inode *in, const void *val, size_t size, bool Client::_vxattrcb_quota_exists(Inode *in) { - return in->quota.is_enable() && + return in->quota.is_enabled() && (in->snapid != CEPH_NOSNAP || (in->snaprealm && in->snaprealm->ino == in->ino)); } @@ -14076,9 +14076,9 @@ int Client::_rename(Inode *fromdir, const char *fromname, Inode *todir, const ch } if (cct->_conf.get_val("client_quota") && fromdir != todir) { Inode *fromdir_root = - fromdir->quota.is_enable(QUOTA_MAX_FILES) ? fromdir : get_quota_root(fromdir, perm, QUOTA_MAX_FILES); + fromdir->quota.is_enabled(QUOTA_MAX_FILES) ? fromdir : get_quota_root(fromdir, perm, QUOTA_MAX_FILES); Inode *todir_root = - todir->quota.is_enable(QUOTA_MAX_FILES) ? todir : get_quota_root(todir, perm, QUOTA_MAX_FILES); + todir->quota.is_enabled(QUOTA_MAX_FILES) ? todir : get_quota_root(todir, perm, QUOTA_MAX_FILES); if (fromdir_root != todir_root) { return -CEPHFS_EXDEV; } @@ -15476,7 +15476,7 @@ Inode *Client::get_quota_root(Inode *in, const UserPerm& perms, quota_max_t type if (p == inode_map.end()) break; - if (p->second->quota.is_enable(type)) { + if (p->second->quota.is_enabled(type)) { quota_in = p->second; break; } diff --git a/src/client/Inode.cc b/src/client/Inode.cc index 5c1523f2f427..ce58a2f14023 100644 --- a/src/client/Inode.cc +++ b/src/client/Inode.cc @@ -85,7 +85,7 @@ ostream& operator<<(ostream &out, const Inode &in) if (in.is_dir() && in.has_dir_layout()) out << " has_dir_layout"; - if (in.quota.is_enable()) + if (in.quota.is_enabled()) out << " " << in.quota; out << ' ' << &in << ")"; diff --git a/src/include/cephfs/types.h b/src/include/cephfs/types.h index 6709e9632dc2..cca0a619305a 100644 --- a/src/include/cephfs/types.h +++ b/src/include/cephfs/types.h @@ -244,7 +244,7 @@ struct quota_info_t bool is_valid() const { return max_bytes >=0 && max_files >=0; } - bool is_enable(quota_max_t type=QUOTA_ANY) const { + bool is_enabled(quota_max_t type=QUOTA_ANY) const { switch (type) { case QUOTA_MAX_FILES: return !!max_files; diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index c3dae0cdb0da..53be1d83fa5e 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -2007,7 +2007,7 @@ void MDCache::broadcast_quota_to_client(CInode *in, client_t exclude_ct, bool qu return; const auto& pi = in->get_projected_inode(); - if (!pi->quota.is_enable() && !quota_change) + if (!pi->quota.is_enabled() && !quota_change) return; // creaete snaprealm for quota inode (quota was set before mimic) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 5ec4aabb6e4f..48b18791c6ef 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -5934,7 +5934,7 @@ void Server::handle_set_vxattr(MDRequestRef& mdr, CInode *cur) return; } - if (quota.is_enable() && !cur->get_projected_srnode()) + if (quota.is_enabled() && !cur->get_projected_srnode()) adjust_realm = true; if (!xlock_policylock(mdr, cur, false, adjust_realm))