diff options
Diffstat (limited to 'fs/reiserfs/inode.c')
-rw-r--r-- | fs/reiserfs/inode.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 073425e6e0a9..0d5817f81972 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -28,7 +28,7 @@ static int reiserfs_prepare_write(struct file *f, struct page *page, | |||
28 | void reiserfs_delete_inode (struct inode * inode) | 28 | void reiserfs_delete_inode (struct inode * inode) |
29 | { | 29 | { |
30 | /* We need blocks for transaction + (user+group) quota update (possibly delete) */ | 30 | /* We need blocks for transaction + (user+group) quota update (possibly delete) */ |
31 | int jbegin_count = JOURNAL_PER_BALANCE_CNT * 2 + 2 * REISERFS_QUOTA_INIT_BLOCKS; | 31 | int jbegin_count = JOURNAL_PER_BALANCE_CNT * 2 + 2 * REISERFS_QUOTA_INIT_BLOCKS(inode->i_sb); |
32 | struct reiserfs_transaction_handle th ; | 32 | struct reiserfs_transaction_handle th ; |
33 | 33 | ||
34 | reiserfs_write_lock(inode->i_sb); | 34 | reiserfs_write_lock(inode->i_sb); |
@@ -591,7 +591,7 @@ int reiserfs_get_block (struct inode * inode, sector_t block, | |||
591 | XXX in practically impossible worst case direct2indirect() | 591 | XXX in practically impossible worst case direct2indirect() |
592 | can incur (much) more than 3 balancings. | 592 | can incur (much) more than 3 balancings. |
593 | quota update for user, group */ | 593 | quota update for user, group */ |
594 | int jbegin_count = JOURNAL_PER_BALANCE_CNT * 3 + 1 + 2 * REISERFS_QUOTA_TRANS_BLOCKS; | 594 | int jbegin_count = JOURNAL_PER_BALANCE_CNT * 3 + 1 + 2 * REISERFS_QUOTA_TRANS_BLOCKS(inode->i_sb); |
595 | int version; | 595 | int version; |
596 | int dangle = 1; | 596 | int dangle = 1; |
597 | loff_t new_offset = (((loff_t)block) << inode->i_sb->s_blocksize_bits) + 1 ; | 597 | loff_t new_offset = (((loff_t)block) << inode->i_sb->s_blocksize_bits) + 1 ; |
@@ -2796,14 +2796,15 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) { | |||
2796 | 2796 | ||
2797 | if (!error) { | 2797 | if (!error) { |
2798 | struct reiserfs_transaction_handle th; | 2798 | struct reiserfs_transaction_handle th; |
2799 | int jbegin_count = 2*(REISERFS_QUOTA_INIT_BLOCKS(inode->i_sb)+REISERFS_QUOTA_DEL_BLOCKS(inode->i_sb))+2; | ||
2799 | 2800 | ||
2800 | /* (user+group)*(old+new) structure - we count quota info and , inode write (sb, inode) */ | 2801 | /* (user+group)*(old+new) structure - we count quota info and , inode write (sb, inode) */ |
2801 | error = journal_begin(&th, inode->i_sb, 4*REISERFS_QUOTA_INIT_BLOCKS+2); | 2802 | error = journal_begin(&th, inode->i_sb, jbegin_count); |
2802 | if (error) | 2803 | if (error) |
2803 | goto out; | 2804 | goto out; |
2804 | error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0; | 2805 | error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0; |
2805 | if (error) { | 2806 | if (error) { |
2806 | journal_end(&th, inode->i_sb, 4*REISERFS_QUOTA_INIT_BLOCKS+2); | 2807 | journal_end(&th, inode->i_sb, jbegin_count); |
2807 | goto out; | 2808 | goto out; |
2808 | } | 2809 | } |
2809 | /* Update corresponding info in inode so that everything is in | 2810 | /* Update corresponding info in inode so that everything is in |
@@ -2813,7 +2814,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) { | |||
2813 | if (attr->ia_valid & ATTR_GID) | 2814 | if (attr->ia_valid & ATTR_GID) |
2814 | inode->i_gid = attr->ia_gid; | 2815 | inode->i_gid = attr->ia_gid; |
2815 | mark_inode_dirty(inode); | 2816 | mark_inode_dirty(inode); |
2816 | error = journal_end(&th, inode->i_sb, 4*REISERFS_QUOTA_INIT_BLOCKS+2); | 2817 | error = journal_end(&th, inode->i_sb, jbegin_count); |
2817 | } | 2818 | } |
2818 | } | 2819 | } |
2819 | if (!error) | 2820 | if (!error) |