diff options
author | Jan Kara <jack@suse.cz> | 2005-06-24 01:01:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 03:05:20 -0400 |
commit | 556a2a45bce1740f035befaa7201e4ad836c7257 (patch) | |
tree | d4a85b6f2bd02ab5c7c194e351508b80035f07c5 /include | |
parent | 1f54587bea84a35125c95e19b98c2f464c50871b (diff) |
[PATCH] quota: reiserfs: improve quota credit estimates
Use improved credits estimates for quota operations. Also reserve space
for a quota operation in a transaction only if filesystem was mounted with
some quota option.
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')
-rw-r--r-- | include/linux/reiserfs_fs.h | 15 | ||||
-rw-r--r-- | include/linux/reiserfs_fs_sb.h | 2 |
2 files changed, 13 insertions, 4 deletions
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 32148625fc2f..4c7c5689ad93 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -1644,11 +1644,18 @@ struct reiserfs_journal_header { | |||
1644 | #define JOURNAL_MAX_TRANS_AGE 30 | 1644 | #define JOURNAL_MAX_TRANS_AGE 30 |
1645 | #define JOURNAL_PER_BALANCE_CNT (3 * (MAX_HEIGHT-2) + 9) | 1645 | #define JOURNAL_PER_BALANCE_CNT (3 * (MAX_HEIGHT-2) + 9) |
1646 | #ifdef CONFIG_QUOTA | 1646 | #ifdef CONFIG_QUOTA |
1647 | #define REISERFS_QUOTA_TRANS_BLOCKS 2 /* We need to update data and inode (atime) */ | 1647 | /* We need to update data and inode (atime) */ |
1648 | #define REISERFS_QUOTA_INIT_BLOCKS (DQUOT_MAX_WRITES*(JOURNAL_PER_BALANCE_CNT+2)+1) /* 1 balancing, 1 bitmap, 1 data per write + stat data update */ | 1648 | #define REISERFS_QUOTA_TRANS_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? 2 : 0) |
1649 | /* 1 balancing, 1 bitmap, 1 data per write + stat data update */ | ||
1650 | #define REISERFS_QUOTA_INIT_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? \ | ||
1651 | (DQUOT_INIT_ALLOC*(JOURNAL_PER_BALANCE_CNT+2)+DQUOT_INIT_REWRITE+1) : 0) | ||
1652 | /* same as with INIT */ | ||
1653 | #define REISERFS_QUOTA_DEL_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? \ | ||
1654 | (DQUOT_DEL_ALLOC*(JOURNAL_PER_BALANCE_CNT+2)+DQUOT_DEL_REWRITE+1) : 0) | ||
1649 | #else | 1655 | #else |
1650 | #define REISERFS_QUOTA_TRANS_BLOCKS 0 | 1656 | #define REISERFS_QUOTA_TRANS_BLOCKS(s) 0 |
1651 | #define REISERFS_QUOTA_INIT_BLOCKS 0 | 1657 | #define REISERFS_QUOTA_INIT_BLOCKS(s) 0 |
1658 | #define REISERFS_QUOTA_DEL_BLOCKS(s) 0 | ||
1652 | #endif | 1659 | #endif |
1653 | 1660 | ||
1654 | /* both of these can be as low as 1, or as high as you want. The min is the | 1661 | /* both of these can be as low as 1, or as high as you want. The min is the |
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 37a3a7afbec7..31c709d0fe18 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h | |||
@@ -467,6 +467,8 @@ enum reiserfs_mount_options { | |||
467 | REISERFS_ERROR_RO, | 467 | REISERFS_ERROR_RO, |
468 | REISERFS_ERROR_CONTINUE, | 468 | REISERFS_ERROR_CONTINUE, |
469 | 469 | ||
470 | REISERFS_QUOTA, /* Some quota option specified */ | ||
471 | |||
470 | REISERFS_TEST1, | 472 | REISERFS_TEST1, |
471 | REISERFS_TEST2, | 473 | REISERFS_TEST2, |
472 | REISERFS_TEST3, | 474 | REISERFS_TEST3, |