ext4: quota macros cleanup
Currently all quota block reservation macros contains hard-coded "2" aka MAXQUOTAS value. This is no good because in some places it is not obvious to understand what does this digit represent. Let's introduce new macro with self descriptive name. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Acked-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
parent
8aa6790f87
commit
5aca07eb7d
5 changed files with 14 additions and 10 deletions
|
@ -238,7 +238,7 @@ static int extend_credit_for_blkdel(handle_t *handle, struct inode *inode)
|
|||
* So allocate a credit of 3. We may update
|
||||
* quota (user and group).
|
||||
*/
|
||||
needed = 3 + 2*EXT4_QUOTA_TRANS_BLOCKS(inode->i_sb);
|
||||
needed = 3 + EXT4_MAXQUOTAS_TRANS_BLOCKS(inode->i_sb);
|
||||
|
||||
if (ext4_journal_extend(handle, needed) != 0)
|
||||
retval = ext4_journal_restart(handle, needed);
|
||||
|
@ -486,7 +486,7 @@ int ext4_ext_migrate(struct inode *inode)
|
|||
handle = ext4_journal_start(inode,
|
||||
EXT4_DATA_TRANS_BLOCKS(inode->i_sb) +
|
||||
EXT4_INDEX_EXTRA_TRANS_BLOCKS + 3 +
|
||||
2 * EXT4_QUOTA_INIT_BLOCKS(inode->i_sb)
|
||||
EXT4_MAXQUOTAS_INIT_BLOCKS(inode->i_sb)
|
||||
+ 1);
|
||||
if (IS_ERR(handle)) {
|
||||
retval = PTR_ERR(handle);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue