summaryrefslogtreecommitdiffstats
path: root/include
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 /include
parent56246f9ae4cfa95b460f9dfbcfb1b772d85db046 (diff)
downloadop-kernel-dev-0e05842bc117ea70ceb979cca798fd026879951b.zip
op-kernel-dev-0e05842bc117ea70ceb979cca798fd026879951b.tar.gz
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 'include')
-rw-r--r--include/linux/quotaops.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 9edd53c..f8dbeb0 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -11,6 +11,7 @@
#define DQUOT_SPACE_WARN 0x1
#define DQUOT_SPACE_RESERVE 0x2
+#define DQUOT_SPACE_NOFAIL 0x4
static inline struct quota_info *sb_dqopt(struct super_block *sb)
{
@@ -262,6 +263,12 @@ static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr)
return __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN);
}
+static inline void dquot_alloc_space_nofail(struct inode *inode, qsize_t nr)
+{
+ __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN|DQUOT_SPACE_NOFAIL);
+ mark_inode_dirty(inode);
+}
+
static inline int dquot_alloc_space(struct inode *inode, qsize_t nr)
{
int ret;
@@ -277,6 +284,11 @@ static inline int dquot_alloc_block_nodirty(struct inode *inode, qsize_t nr)
return dquot_alloc_space_nodirty(inode, nr << inode->i_blkbits);
}
+static inline void dquot_alloc_block_nofail(struct inode *inode, qsize_t nr)
+{
+ dquot_alloc_space_nofail(inode, nr << inode->i_blkbits);
+}
+
static inline int dquot_alloc_block(struct inode *inode, qsize_t nr)
{
return dquot_alloc_space(inode, nr << inode->i_blkbits);
OpenPOWER on IntegriCloud