Skip to content

Commit

Permalink
quota: code cleanup for __dquot_alloc_space()
Browse files Browse the repository at this point in the history
Replace (flags & DQUOT_SPACE_RESERVE) with
variable reserve.

Signed-off-by: Chengguang Xu <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
Chengguang Xu authored and jankara committed Mar 26, 2019
1 parent 1206d02 commit df15a2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/quota/dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit df15a2a

Please sign in to comment.