quota: code cleanup for __dquot_alloc_space()
authorChengguang Xu <cgxu519@gmx.com>
Wed, 20 Mar 2019 05:03:59 +0000 (13:03 +0800)
committerJan Kara <jack@suse.cz>
Tue, 26 Mar 2019 10:21:23 +0000 (11:21 +0100)
Replace (flags & DQUOT_SPACE_RESERVE) with
variable reserve.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/quota/dquot.c

index fc20e06..00de508 100644 (file)
@@ -1663,7 +1663,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 {
@@ -1676,7 +1676,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 {