quota: rename dquot_active() to inode_quota_active()

Now we have a helper function dquot_dirty() to determine if dquot has
DQ_MOD_B bit. dquot_active() can easily be misunderstood as a helper
function to determine if dquot has DQ_ACTIVE_B bit. So we avoid this by
renaming it to inode_quota_active() and later on we will add the helper
function dquot_active() to determine if dquot has DQ_ACTIVE_B bit.

Signed-off-by: Baokun Li <libaokun1@huawei.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Message-Id: <20230630110822.3881712-3-libaokun1@huawei.com>
This commit is contained in:
Baokun Li 2023-06-30 19:08:19 +08:00 committed by Jan Kara
parent 0241284778
commit 4b9bdfa165

View File

@ -1418,7 +1418,7 @@ static int info_bdq_free(struct dquot *dquot, qsize_t space)
return QUOTA_NL_NOWARN; return QUOTA_NL_NOWARN;
} }
static int dquot_active(const struct inode *inode) static int inode_quota_active(const struct inode *inode)
{ {
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
@ -1441,7 +1441,7 @@ static int __dquot_initialize(struct inode *inode, int type)
qsize_t rsv; qsize_t rsv;
int ret = 0; int ret = 0;
if (!dquot_active(inode)) if (!inode_quota_active(inode))
return 0; return 0;
dquots = i_dquot(inode); dquots = i_dquot(inode);
@ -1549,7 +1549,7 @@ bool dquot_initialize_needed(struct inode *inode)
struct dquot **dquots; struct dquot **dquots;
int i; int i;
if (!dquot_active(inode)) if (!inode_quota_active(inode))
return false; return false;
dquots = i_dquot(inode); dquots = i_dquot(inode);
@ -1660,7 +1660,7 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags)
int reserve = flags & DQUOT_SPACE_RESERVE; int reserve = flags & DQUOT_SPACE_RESERVE;
struct dquot **dquots; struct dquot **dquots;
if (!dquot_active(inode)) { if (!inode_quota_active(inode)) {
if (reserve) { if (reserve) {
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
*inode_reserved_space(inode) += number; *inode_reserved_space(inode) += number;
@ -1730,7 +1730,7 @@ int dquot_alloc_inode(struct inode *inode)
struct dquot_warn warn[MAXQUOTAS]; struct dquot_warn warn[MAXQUOTAS];
struct dquot * const *dquots; struct dquot * const *dquots;
if (!dquot_active(inode)) if (!inode_quota_active(inode))
return 0; return 0;
for (cnt = 0; cnt < MAXQUOTAS; cnt++) for (cnt = 0; cnt < MAXQUOTAS; cnt++)
warn[cnt].w_type = QUOTA_NL_NOWARN; warn[cnt].w_type = QUOTA_NL_NOWARN;
@ -1773,7 +1773,7 @@ int dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
struct dquot **dquots; struct dquot **dquots;
int cnt, index; int cnt, index;
if (!dquot_active(inode)) { if (!inode_quota_active(inode)) {
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
*inode_reserved_space(inode) -= number; *inode_reserved_space(inode) -= number;
__inode_add_bytes(inode, number); __inode_add_bytes(inode, number);
@ -1815,7 +1815,7 @@ void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number)
struct dquot **dquots; struct dquot **dquots;
int cnt, index; int cnt, index;
if (!dquot_active(inode)) { if (!inode_quota_active(inode)) {
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
*inode_reserved_space(inode) += number; *inode_reserved_space(inode) += number;
__inode_sub_bytes(inode, number); __inode_sub_bytes(inode, number);
@ -1859,7 +1859,7 @@ void __dquot_free_space(struct inode *inode, qsize_t number, int flags)
struct dquot **dquots; struct dquot **dquots;
int reserve = flags & DQUOT_SPACE_RESERVE, index; int reserve = flags & DQUOT_SPACE_RESERVE, index;
if (!dquot_active(inode)) { if (!inode_quota_active(inode)) {
if (reserve) { if (reserve) {
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
*inode_reserved_space(inode) -= number; *inode_reserved_space(inode) -= number;
@ -1914,7 +1914,7 @@ void dquot_free_inode(struct inode *inode)
struct dquot * const *dquots; struct dquot * const *dquots;
int index; int index;
if (!dquot_active(inode)) if (!inode_quota_active(inode))
return; return;
dquots = i_dquot(inode); dquots = i_dquot(inode);
@ -2086,7 +2086,7 @@ int dquot_transfer(struct mnt_idmap *idmap, struct inode *inode,
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
int ret; int ret;
if (!dquot_active(inode)) if (!inode_quota_active(inode))
return 0; return 0;
if (i_uid_needs_update(idmap, iattr, inode)) { if (i_uid_needs_update(idmap, iattr, inode)) {