Skip to content

Commit

Permalink
quota: Remove bogus 'optimization' in check_idq() and check_bdq()
Browse files Browse the repository at this point in the history
Checks like <= 0 for an unsigned type do not make much sence. The value
could be only 0 and that does not happen often enough for the check
to be worth it.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
  • Loading branch information
Jan Kara authored and Mark Fasheh committed Jan 5, 2009
1 parent 1209546 commit 1497d3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ static inline char ignore_hardlimit(struct dquot *dquot)
static int check_idq(struct dquot *dquot, qsize_t inodes, char *warntype)
{
*warntype = QUOTA_NL_NOWARN;
if (inodes <= 0 || test_bit(DQ_FAKE_B, &dquot->dq_flags))
if (test_bit(DQ_FAKE_B, &dquot->dq_flags))
return QUOTA_OK;

if (dquot->dq_dqb.dqb_ihardlimit &&
Expand Down Expand Up @@ -1073,7 +1073,7 @@ static int check_idq(struct dquot *dquot, qsize_t inodes, char *warntype)
static int check_bdq(struct dquot *dquot, qsize_t space, int prealloc, char *warntype)
{
*warntype = QUOTA_NL_NOWARN;
if (space <= 0 || test_bit(DQ_FAKE_B, &dquot->dq_flags))
if (test_bit(DQ_FAKE_B, &dquot->dq_flags))
return QUOTA_OK;

if (dquot->dq_dqb.dqb_bhardlimit &&
Expand Down

0 comments on commit 1497d3a

Please sign in to comment.