From: Jan Kara 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 Signed-off-by: Andrew Morton --- include/linux/dqblk_v1.h | 6 ++++++ include/linux/dqblk_v2.h | 6 ++++++ include/linux/quota.h | 7 +++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff -puN include/linux/dqblk_v1.h~quota-improve-credits-estimates include/linux/dqblk_v1.h --- 25/include/linux/dqblk_v1.h~quota-improve-credits-estimates 2005-05-25 00:05:43.000000000 -0700 +++ 25-akpm/include/linux/dqblk_v1.h 2005-05-25 00:05:43.000000000 -0700 @@ -11,6 +11,12 @@ /* Root squash turned on */ #define V1_DQF_RSQUASH 1 +/* Numbers of blocks needed for updates */ +#define V1_INIT_ALLOC 1 +#define V1_INIT_REWRITE 1 +#define V1_DEL_ALLOC 0 +#define V1_DEL_REWRITE 2 + /* Special information about quotafile */ struct v1_mem_dqinfo { }; diff -puN include/linux/dqblk_v2.h~quota-improve-credits-estimates include/linux/dqblk_v2.h --- 25/include/linux/dqblk_v2.h~quota-improve-credits-estimates 2005-05-25 00:05:43.000000000 -0700 +++ 25-akpm/include/linux/dqblk_v2.h 2005-05-25 00:05:43.000000000 -0700 @@ -10,6 +10,12 @@ /* id numbers of quota format */ #define QFMT_VFS_V0 2 +/* Numbers of blocks needed for updates */ +#define V2_INIT_ALLOC 4 +#define V2_INIT_REWRITE 2 +#define V2_DEL_ALLOC 0 +#define V2_DEL_REWRITE 6 + /* Inmemory copy of version specific information */ struct v2_mem_dqinfo { unsigned int dqi_blocks; diff -puN include/linux/quota.h~quota-improve-credits-estimates include/linux/quota.h --- 25/include/linux/quota.h~quota-improve-credits-estimates 2005-05-25 00:05:43.000000000 -0700 +++ 25-akpm/include/linux/quota.h 2005-05-25 00:05:43.000000000 -0700 @@ -138,8 +138,11 @@ struct if_dqinfo { #include /* Maximal numbers of writes for quota operation (insert/delete/update) - * (over all formats) - info block, 4 pointer blocks, data block */ -#define DQUOT_MAX_WRITES 6 + * (over VFS all formats) */ +#define DQUOT_INIT_ALLOC max(V1_INIT_ALLOC, V2_INIT_ALLOC) +#define DQUOT_INIT_REWRITE max(V1_INIT_REWRITE, V2_INIT_REWRITE) +#define DQUOT_DEL_ALLOC max(V1_DEL_ALLOC, V2_DEL_ALLOC) +#define DQUOT_DEL_REWRITE max(V1_DEL_REWRITE, V2_DEL_REWRITE) /* * Data for one user/group kept in memory _