diff options
author | Jan Kara <jack@suse.cz> | 2005-06-24 01:01:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 03:05:20 -0400 |
commit | 1f54587bea84a35125c95e19b98c2f464c50871b (patch) | |
tree | 42f2467d6892be821271a2257e1259922bdafd45 /fs/ext3/inode.c | |
parent | 4e5117ba0af4582b6ec9164874f719d7f3f1eb2b (diff) |
[PATCH] quota: ext3: Improve quota credit estimates
Use improved credits estimates for quota operations. Also reserve a space
for a quota operation in a transaction only if filesystem was mounted with
some quota options.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ext3/inode.c')
-rw-r--r-- | fs/ext3/inode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 0d5fa73b18dc..0b2db4f618cb 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -128,7 +128,7 @@ static unsigned long blocks_for_truncate(struct inode *inode) | |||
128 | if (needed > EXT3_MAX_TRANS_DATA) | 128 | if (needed > EXT3_MAX_TRANS_DATA) |
129 | needed = EXT3_MAX_TRANS_DATA; | 129 | needed = EXT3_MAX_TRANS_DATA; |
130 | 130 | ||
131 | return EXT3_DATA_TRANS_BLOCKS + needed; | 131 | return EXT3_DATA_TRANS_BLOCKS(inode->i_sb) + needed; |
132 | } | 132 | } |
133 | 133 | ||
134 | /* | 134 | /* |
@@ -2763,7 +2763,8 @@ int ext3_setattr(struct dentry *dentry, struct iattr *attr) | |||
2763 | 2763 | ||
2764 | /* (user+group)*(old+new) structure, inode write (sb, | 2764 | /* (user+group)*(old+new) structure, inode write (sb, |
2765 | * inode block, ? - but truncate inode update has it) */ | 2765 | * inode block, ? - but truncate inode update has it) */ |
2766 | handle = ext3_journal_start(inode, 4*EXT3_QUOTA_INIT_BLOCKS+3); | 2766 | handle = ext3_journal_start(inode, 2*(EXT3_QUOTA_INIT_BLOCKS(inode->i_sb)+ |
2767 | EXT3_QUOTA_DEL_BLOCKS(inode->i_sb))+3); | ||
2767 | if (IS_ERR(handle)) { | 2768 | if (IS_ERR(handle)) { |
2768 | error = PTR_ERR(handle); | 2769 | error = PTR_ERR(handle); |
2769 | goto err_out; | 2770 | goto err_out; |
@@ -2861,7 +2862,7 @@ static int ext3_writepage_trans_blocks(struct inode *inode) | |||
2861 | #ifdef CONFIG_QUOTA | 2862 | #ifdef CONFIG_QUOTA |
2862 | /* We know that structure was already allocated during DQUOT_INIT so | 2863 | /* We know that structure was already allocated during DQUOT_INIT so |
2863 | * we will be updating only the data blocks + inodes */ | 2864 | * we will be updating only the data blocks + inodes */ |
2864 | ret += 2*EXT3_QUOTA_TRANS_BLOCKS; | 2865 | ret += 2*EXT3_QUOTA_TRANS_BLOCKS(inode->i_sb); |
2865 | #endif | 2866 | #endif |
2866 | 2867 | ||
2867 | return ret; | 2868 | return ret; |