summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2019-03-20 13:03:59 +0800
committerSasha Levin <sashal@kernel.org>2024-03-26 18:22:39 -0400
commitd9e4ab12b60a49204435102f8120c0d3e62583f1 (patch)
treecd160df01b2057b7d86c2e28348d012f97579462
parentd258d124f435adb3cac491e4b0274e75597f3a02 (diff)
downloadlinux-stable-d9e4ab12b60a49204435102f8120c0d3e62583f1.tar.gz
linux-stable-d9e4ab12b60a49204435102f8120c0d3e62583f1.tar.bz2
linux-stable-d9e4ab12b60a49204435102f8120c0d3e62583f1.zip
quota: code cleanup for __dquot_alloc_space()
[ Upstream commit df15a2a59d0b29d86e17140b83ed231adaded12f ] Replace (flags & DQUOT_SPACE_RESERVE) with variable reserve. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Signed-off-by: Jan Kara <jack@suse.cz> Stable-dep-of: 179b8c97ebf6 ("quota: Fix rcu annotations of inode dquot pointers") Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/quota/dquot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 868936076f41..683727c5758c 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1743,7 +1743,7 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags)
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
if (!dquots[cnt])
continue;
- if (flags & DQUOT_SPACE_RESERVE) {
+ if (reserve) {
ret = dquot_add_space(dquots[cnt], 0, number, flags,
&warn[cnt]);
} else {
@@ -1756,7 +1756,7 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags)
if (!dquots[cnt])
continue;
spin_lock(&dquots[cnt]->dq_dqb_lock);
- if (flags & DQUOT_SPACE_RESERVE) {
+ if (reserve) {
dquots[cnt]->dq_dqb.dqb_rsvspace -=
number;
} else {