diff options
author | Dmitry Monakhov <dmonakhov@openvz.org> | 2009-12-14 15:21:13 +0300 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2009-12-23 13:33:54 +0100 |
commit | fd8fbfc1709822bd94247c5b2ab15a5f5041e103 (patch) | |
tree | 225be57d6afafcd7c893c5b9026719f9b23def69 /include/linux/quota.h | |
parent | b462707e7ccad058ae151e5c5b06eb5cadcb737f (diff) | |
download | linux-fd8fbfc1709822bd94247c5b2ab15a5f5041e103.tar.gz linux-fd8fbfc1709822bd94247c5b2ab15a5f5041e103.tar.bz2 linux-fd8fbfc1709822bd94247c5b2ab15a5f5041e103.zip |
quota: decouple fs reserved space from quota reservation
Currently inode_reservation is managed by fs itself and this
reservation is transfered on dquot_transfer(). This means what
inode_reservation must always be in sync with
dquot->dq_dqb.dqb_rsvspace. Otherwise dquot_transfer() will result
in incorrect quota(WARN_ON in dquot_claim_reserved_space() will be
triggered)
This is not easy because of complex locking order issues
for example http://bugzilla.kernel.org/show_bug.cgi?id=14739
The patch introduce quota reservation field for each fs-inode
(fs specific inode is used in order to prevent bloating generic
vfs inode). This reservation is managed by quota code internally
similar to i_blocks/i_bytes and may not be always in sync with
internal fs reservation.
Also perform some code rearrangement:
- Unify dquot_reserve_space() and dquot_reserve_space()
- Unify dquot_release_reserved_space() and dquot_free_space()
- Also this patch add missing warning update to release_rsv()
dquot_release_reserved_space() must call flush_warnings() as
dquot_free_space() does.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/linux/quota.h')
-rw-r--r-- | include/linux/quota.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h index e70e62194243..a6861f117480 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h @@ -315,8 +315,9 @@ struct dquot_operations { int (*claim_space) (struct inode *, qsize_t); /* release rsved quota for delayed alloc */ void (*release_rsv) (struct inode *, qsize_t); - /* get reserved quota for delayed alloc */ - qsize_t (*get_reserved_space) (struct inode *); + /* get reserved quota for delayed alloc, value returned is managed by + * quota code only */ + qsize_t *(*get_reserved_space) (struct inode *); }; /* Operations handling requests from userspace */ |