aboutsummaryrefslogtreecommitdiffstats
path: root/fs/quota
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2010-05-16 10:00:00 -0400
committerTheodore Ts'o <tytso@mit.edu>2010-05-16 10:00:00 -0400
commit0e05842bc117ea70ceb979cca798fd026879951b (patch)
tree9cac03004706c912b15a859d9e35fedd496653b2 /fs/quota
parent56246f9ae4cfa95b460f9dfbcfb1b772d85db046 (diff)
quota: add the option to not fail with EDQUOT in block
To simplify metadata tracking for delalloc writes, ext4 will simply claim metadata blocks at allocation time, without first speculatively reserving the worst case and then freeing what was not used. To do this, we need a mechanism to track allocations in the quota subsystem, but potentially allow that allocation to actually go over quota. This patch adds a DQUOT_SPACE_NOFAIL flag and function variants for this purpose. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/quota')
-rw-r--r--fs/quota/dquot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 8c40c07797a..df6832ec17c 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1494,6 +1494,7 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags)
1494 char warntype[MAXQUOTAS]; 1494 char warntype[MAXQUOTAS];
1495 int warn = flags & DQUOT_SPACE_WARN; 1495 int warn = flags & DQUOT_SPACE_WARN;
1496 int reserve = flags & DQUOT_SPACE_RESERVE; 1496 int reserve = flags & DQUOT_SPACE_RESERVE;
1497 int nofail = flags & DQUOT_SPACE_NOFAIL;
1497 1498
1498 /* 1499 /*
1499 * First test before acquiring mutex - solves deadlocks when we 1500 * First test before acquiring mutex - solves deadlocks when we
@@ -1514,7 +1515,7 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags)
1514 continue; 1515 continue;
1515 ret = check_bdq(inode->i_dquot[cnt], number, !warn, 1516 ret = check_bdq(inode->i_dquot[cnt], number, !warn,
1516 warntype+cnt); 1517 warntype+cnt);
1517 if (ret) { 1518 if (ret && !nofail) {
1518 spin_unlock(&dq_data_lock); 1519 spin_unlock(&dq_data_lock);
1519 goto out_flush_warn; 1520 goto out_flush_warn;
1520 } 1521 }