Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125830
b: refs/heads/master
c: db49d2d
h: refs/heads/master
v: v3
  • Loading branch information
Jan Kara authored and Mark Fasheh committed Jan 5, 2009
1 parent f89baa6 commit c0a4493
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e3d4d56b9715e40ded2a84d0d4fa7f3b6c58983c
refs/heads/master: db49d2df489f727096438706a5428115e84a3f0d
6 changes: 4 additions & 2 deletions trunk/fs/dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,8 @@ static inline void dquot_incr_space(struct dquot *dquot, qsize_t number)

static inline void dquot_decr_inodes(struct dquot *dquot, qsize_t number)
{
if (dquot->dq_dqb.dqb_curinodes > number)
if (sb_dqopt(dquot->dq_sb)->flags & DQUOT_NEGATIVE_USAGE ||
dquot->dq_dqb.dqb_curinodes >= number)
dquot->dq_dqb.dqb_curinodes -= number;
else
dquot->dq_dqb.dqb_curinodes = 0;
Expand All @@ -858,7 +859,8 @@ static inline void dquot_decr_inodes(struct dquot *dquot, qsize_t number)

static inline void dquot_decr_space(struct dquot *dquot, qsize_t number)
{
if (dquot->dq_dqb.dqb_curspace > number)
if (sb_dqopt(dquot->dq_sb)->flags & DQUOT_NEGATIVE_USAGE ||
dquot->dq_dqb.dqb_curspace >= number)
dquot->dq_dqb.dqb_curspace -= number;
else
dquot->dq_dqb.dqb_curspace = 0;
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/quota.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ enum {
#include <asm/atomic.h>

typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */
typedef __u64 qsize_t; /* Type in which we store sizes */
typedef long long qsize_t; /* Type in which we store sizes */

extern spinlock_t dq_data_lock;

Expand Down Expand Up @@ -336,6 +336,7 @@ enum {
* responsible for setting
* S_NOQUOTA, S_NOATIME flags
*/
#define DQUOT_NEGATIVE_USAGE (1 << 7) /* Allow negative quota usage */

static inline unsigned int dquot_state_flag(unsigned int flags, int type)
{
Expand Down

0 comments on commit c0a4493

Please sign in to comment.