diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-05 16:20:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-05 16:20:53 -0500 |
commit | e213e26ab3988c516c06eba4dcd030ac052f6dc9 (patch) | |
tree | 6e26fbdbb842b387697d73daf6e70cf718269a77 /fs/reiserfs/inode.c | |
parent | c812a51d11bbe983f4c24e32b59b265705ddd3c2 (diff) | |
parent | efd8f0e6f6c1faa041f228d7113bd3a9db802d49 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: (33 commits)
quota: stop using QUOTA_OK / NO_QUOTA
dquot: cleanup dquot initialize routine
dquot: move dquot initialization responsibility into the filesystem
dquot: cleanup dquot drop routine
dquot: move dquot drop responsibility into the filesystem
dquot: cleanup dquot transfer routine
dquot: move dquot transfer responsibility into the filesystem
dquot: cleanup inode allocation / freeing routines
dquot: cleanup space allocation / freeing routines
ext3: add writepage sanity checks
ext3: Truncate allocated blocks if direct IO write fails to update i_size
quota: Properly invalidate caches even for filesystems with blocksize < pagesize
quota: generalize quota transfer interface
quota: sb_quota state flags cleanup
jbd: Delay discarding buffers in journal_unmap_buffer
ext3: quota_write cross block boundary behaviour
quota: drop permission checks from xfs_fs_set_xstate/xfs_fs_set_xquota
quota: split out compat_sys_quotactl support from quota.c
quota: split out netlink notification support from quota.c
quota: remove invalid optimization from quota_sync_all
...
Fixed trivial conflicts in fs/namei.c and fs/ufs/inode.c
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); |