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 /include/linux | |
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 'include/linux')
-rw-r--r-- | include/linux/ext3_fs.h | 1 | ||||
-rw-r--r-- | include/linux/ext3_jbd.h | 19 |
2 files changed, 12 insertions, 8 deletions
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 74ad31781e3e..4b6e1ab216a5 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -358,6 +358,7 @@ struct ext3_inode { | |||
358 | #define EXT3_MOUNT_RESERVATION 0x10000 /* Preallocation */ | 358 | #define EXT3_MOUNT_RESERVATION 0x10000 /* Preallocation */ |
359 | #define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */ | 359 | #define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */ |
360 | #define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */ | 360 | #define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */ |
361 | #define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */ | ||
361 | 362 | ||
362 | /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ | 363 | /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ |
363 | #ifndef _LINUX_EXT2_FS_H | 364 | #ifndef _LINUX_EXT2_FS_H |
diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h index e8292af9033b..c8307c02dd07 100644 --- a/include/linux/ext3_jbd.h +++ b/include/linux/ext3_jbd.h | |||
@@ -42,15 +42,15 @@ | |||
42 | * superblock only gets updated once, of course, so don't bother | 42 | * superblock only gets updated once, of course, so don't bother |
43 | * counting that again for the quota updates. */ | 43 | * counting that again for the quota updates. */ |
44 | 44 | ||
45 | #define EXT3_DATA_TRANS_BLOCKS (EXT3_SINGLEDATA_TRANS_BLOCKS + \ | 45 | #define EXT3_DATA_TRANS_BLOCKS(sb) (EXT3_SINGLEDATA_TRANS_BLOCKS + \ |
46 | EXT3_XATTR_TRANS_BLOCKS - 2 + \ | 46 | EXT3_XATTR_TRANS_BLOCKS - 2 + \ |
47 | 2*EXT3_QUOTA_TRANS_BLOCKS) | 47 | 2*EXT3_QUOTA_TRANS_BLOCKS(sb)) |
48 | 48 | ||
49 | /* Delete operations potentially hit one directory's namespace plus an | 49 | /* Delete operations potentially hit one directory's namespace plus an |
50 | * entire inode, plus arbitrary amounts of bitmap/indirection data. Be | 50 | * entire inode, plus arbitrary amounts of bitmap/indirection data. Be |
51 | * generous. We can grow the delete transaction later if necessary. */ | 51 | * generous. We can grow the delete transaction later if necessary. */ |
52 | 52 | ||
53 | #define EXT3_DELETE_TRANS_BLOCKS (2 * EXT3_DATA_TRANS_BLOCKS + 64) | 53 | #define EXT3_DELETE_TRANS_BLOCKS(sb) (2 * EXT3_DATA_TRANS_BLOCKS(sb) + 64) |
54 | 54 | ||
55 | /* Define an arbitrary limit for the amount of data we will anticipate | 55 | /* Define an arbitrary limit for the amount of data we will anticipate |
56 | * writing to any given transaction. For unbounded transactions such as | 56 | * writing to any given transaction. For unbounded transactions such as |
@@ -74,14 +74,17 @@ | |||
74 | #ifdef CONFIG_QUOTA | 74 | #ifdef CONFIG_QUOTA |
75 | /* Amount of blocks needed for quota update - we know that the structure was | 75 | /* Amount of blocks needed for quota update - we know that the structure was |
76 | * allocated so we need to update only inode+data */ | 76 | * allocated so we need to update only inode+data */ |
77 | #define EXT3_QUOTA_TRANS_BLOCKS 2 | 77 | #define EXT3_QUOTA_TRANS_BLOCKS(sb) (test_opt(sb, QUOTA) ? 2 : 0) |
78 | /* Amount of blocks needed for quota insert/delete - we do some block writes | 78 | /* Amount of blocks needed for quota insert/delete - we do some block writes |
79 | * but inode, sb and group updates are done only once */ | 79 | * but inode, sb and group updates are done only once */ |
80 | #define EXT3_QUOTA_INIT_BLOCKS (DQUOT_MAX_WRITES*\ | 80 | #define EXT3_QUOTA_INIT_BLOCKS(sb) (test_opt(sb, QUOTA) ? (DQUOT_INIT_ALLOC*\ |
81 | (EXT3_SINGLEDATA_TRANS_BLOCKS-3)+3) | 81 | (EXT3_SINGLEDATA_TRANS_BLOCKS-3)+3+DQUOT_INIT_REWRITE) : 0) |
82 | #define EXT3_QUOTA_DEL_BLOCKS(sb) (test_opt(sb, QUOTA) ? (DQUOT_DEL_ALLOC*\ | ||
83 | (EXT3_SINGLEDATA_TRANS_BLOCKS-3)+3+DQUOT_DEL_REWRITE) : 0) | ||
82 | #else | 84 | #else |
83 | #define EXT3_QUOTA_TRANS_BLOCKS 0 | 85 | #define EXT3_QUOTA_TRANS_BLOCKS(sb) 0 |
84 | #define EXT3_QUOTA_INIT_BLOCKS 0 | 86 | #define EXT3_QUOTA_INIT_BLOCKS(sb) 0 |
87 | #define EXT3_QUOTA_DEL_BLOCKS(sb) 0 | ||
85 | #endif | 88 | #endif |
86 | 89 | ||
87 | int | 90 | int |