Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] quota: improve credits estimates

Improve estimates on the number of needed credits for quota transaction.
Now we distinguish blocks that might need to be allocated and blocks that
only need to be rewritten. Also we distinguish deleting of a quota
structure and creating of a new one.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Jan Kara and committed by
Linus Torvalds
4e5117ba bd6a1f16

+17 -2
+6
include/linux/dqblk_v1.h
··· 11 11 /* Root squash turned on */ 12 12 #define V1_DQF_RSQUASH 1 13 13 14 + /* Numbers of blocks needed for updates */ 15 + #define V1_INIT_ALLOC 1 16 + #define V1_INIT_REWRITE 1 17 + #define V1_DEL_ALLOC 0 18 + #define V1_DEL_REWRITE 2 19 + 14 20 /* Special information about quotafile */ 15 21 struct v1_mem_dqinfo { 16 22 };
+6
include/linux/dqblk_v2.h
··· 10 10 /* id numbers of quota format */ 11 11 #define QFMT_VFS_V0 2 12 12 13 + /* Numbers of blocks needed for updates */ 14 + #define V2_INIT_ALLOC 4 15 + #define V2_INIT_REWRITE 2 16 + #define V2_DEL_ALLOC 0 17 + #define V2_DEL_REWRITE 6 18 + 13 19 /* Inmemory copy of version specific information */ 14 20 struct v2_mem_dqinfo { 15 21 unsigned int dqi_blocks;
+5 -2
include/linux/quota.h
··· 138 138 #include <linux/dqblk_v2.h> 139 139 140 140 /* Maximal numbers of writes for quota operation (insert/delete/update) 141 - * (over all formats) - info block, 4 pointer blocks, data block */ 142 - #define DQUOT_MAX_WRITES 6 141 + * (over VFS all formats) */ 142 + #define DQUOT_INIT_ALLOC max(V1_INIT_ALLOC, V2_INIT_ALLOC) 143 + #define DQUOT_INIT_REWRITE max(V1_INIT_REWRITE, V2_INIT_REWRITE) 144 + #define DQUOT_DEL_ALLOC max(V1_DEL_ALLOC, V2_DEL_ALLOC) 145 + #define DQUOT_DEL_REWRITE max(V1_DEL_REWRITE, V2_DEL_REWRITE) 143 146 144 147 /* 145 148 * Data for one user/group kept in memory