diff options
Diffstat (limited to 'fs/reiserfs/inode.c')
-rw-r--r-- | fs/reiserfs/inode.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 0d651f980a8d..d1da94b82d8f 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -34,6 +34,9 @@ void reiserfs_delete_inode(struct inode *inode) | |||
34 | int depth; | 34 | int depth; |
35 | int err; | 35 | int err; |
36 | 36 | ||
37 | if (!is_bad_inode(inode)) | ||
38 | dquot_initialize(inode); | ||
39 | |||
37 | truncate_inode_pages(&inode->i_data, 0); | 40 | truncate_inode_pages(&inode->i_data, 0); |
38 | 41 | ||
39 | depth = reiserfs_write_lock_once(inode->i_sb); | 42 | depth = reiserfs_write_lock_once(inode->i_sb); |
@@ -54,7 +57,7 @@ void reiserfs_delete_inode(struct inode *inode) | |||
54 | * after delete_object so that quota updates go into the same transaction as | 57 | * after delete_object so that quota updates go into the same transaction as |
55 | * stat data deletion */ | 58 | * stat data deletion */ |
56 | if (!err) | 59 | if (!err) |
57 | vfs_dq_free_inode(inode); | 60 | dquot_free_inode(inode); |
58 | 61 | ||
59 | if (journal_end(&th, inode->i_sb, jbegin_count)) | 62 | if (journal_end(&th, inode->i_sb, jbegin_count)) |
60 | goto out; | 63 | goto out; |
@@ -1765,10 +1768,10 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | |||
1765 | 1768 | ||
1766 | BUG_ON(!th->t_trans_id); | 1769 | BUG_ON(!th->t_trans_id); |
1767 | 1770 | ||
1768 | if (vfs_dq_alloc_inode(inode)) { | 1771 | dquot_initialize(inode); |
1769 | err = -EDQUOT; | 1772 | err = dquot_alloc_inode(inode); |
1773 | if (err) | ||
1770 | goto out_end_trans; | 1774 | goto out_end_trans; |
1771 | } | ||
1772 | if (!dir->i_nlink) { | 1775 | if (!dir->i_nlink) { |
1773 | err = -EPERM; | 1776 | err = -EPERM; |
1774 | goto out_bad_inode; | 1777 | goto out_bad_inode; |
@@ -1959,12 +1962,12 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | |||
1959 | INODE_PKEY(inode)->k_objectid = 0; | 1962 | INODE_PKEY(inode)->k_objectid = 0; |
1960 | 1963 | ||
1961 | /* Quota change must be inside a transaction for journaling */ | 1964 | /* Quota change must be inside a transaction for journaling */ |
1962 | vfs_dq_free_inode(inode); | 1965 | dquot_free_inode(inode); |
1963 | 1966 | ||
1964 | out_end_trans: | 1967 | out_end_trans: |
1965 | journal_end(th, th->t_super, th->t_blocks_allocated); | 1968 | journal_end(th, th->t_super, th->t_blocks_allocated); |
1966 | /* Drop can be outside and it needs more credits so it's better to have it outside */ | 1969 | /* Drop can be outside and it needs more credits so it's better to have it outside */ |
1967 | vfs_dq_drop(inode); | 1970 | dquot_drop(inode); |
1968 | inode->i_flags |= S_NOQUOTA; | 1971 | inode->i_flags |= S_NOQUOTA; |
1969 | make_bad_inode(inode); | 1972 | make_bad_inode(inode); |
1970 | 1973 | ||
@@ -3073,6 +3076,8 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
3073 | 3076 | ||
3074 | depth = reiserfs_write_lock_once(inode->i_sb); | 3077 | depth = reiserfs_write_lock_once(inode->i_sb); |
3075 | if (attr->ia_valid & ATTR_SIZE) { | 3078 | if (attr->ia_valid & ATTR_SIZE) { |
3079 | dquot_initialize(inode); | ||
3080 | |||
3076 | /* version 2 items will be caught by the s_maxbytes check | 3081 | /* version 2 items will be caught by the s_maxbytes check |
3077 | ** done for us in vmtruncate | 3082 | ** done for us in vmtruncate |
3078 | */ | 3083 | */ |
@@ -3134,8 +3139,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
3134 | jbegin_count); | 3139 | jbegin_count); |
3135 | if (error) | 3140 | if (error) |
3136 | goto out; | 3141 | goto out; |
3137 | error = | 3142 | error = dquot_transfer(inode, attr); |
3138 | vfs_dq_transfer(inode, attr) ? -EDQUOT : 0; | ||
3139 | if (error) { | 3143 | if (error) { |
3140 | journal_end(&th, inode->i_sb, | 3144 | journal_end(&th, inode->i_sb, |
3141 | jbegin_count); | 3145 | jbegin_count); |