mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
quota: Add quota reservation support
Delayed allocation defers the block allocation at the dirty pages flush-out time, doing quota charge/check at that time is too late. But we can't charge the quota blocks until blocks are really allocated, otherwise users could get overcharged after reboot from system crash. This patch adds quota reservation for delayed allocation. Quota blocks are reserved in memory, inode and quota won't gets dirtied until later block allocation time. Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
8e0ee43bc2
commit
f18df22899
3 changed files with 111 additions and 32 deletions
|
@ -198,6 +198,7 @@ struct mem_dqblk {
|
|||
qsize_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
|
||||
qsize_t dqb_bsoftlimit; /* preferred limit on disk blks */
|
||||
qsize_t dqb_curspace; /* current used space */
|
||||
qsize_t dqb_rsvspace; /* current reserved space for delalloc*/
|
||||
qsize_t dqb_ihardlimit; /* absolute limit on allocated inodes */
|
||||
qsize_t dqb_isoftlimit; /* preferred inode limit */
|
||||
qsize_t dqb_curinodes; /* current # allocated inodes */
|
||||
|
@ -308,6 +309,8 @@ struct dquot_operations {
|
|||
int (*release_dquot) (struct dquot *); /* Quota is going to be deleted from disk */
|
||||
int (*mark_dirty) (struct dquot *); /* Dquot is marked dirty */
|
||||
int (*write_info) (struct super_block *, int); /* Write of quota "superblock" */
|
||||
/* reserve quota for delayed block allocation */
|
||||
int (*reserve_space) (struct inode *, qsize_t, int);
|
||||
};
|
||||
|
||||
/* Operations handling requests from userspace */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue