diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-06-07 11:37:37 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-08-09 16:48:23 -0400 |
commit | 845a2cc0507055278e0fa722ed0f8c791b7401dd (patch) | |
tree | 73902e3bd0fbb4dffd3676070b4b0a296f4238e4 /fs/reiserfs/inode.c | |
parent | bd55597520a2eaa0d71dd7683513a14bfd1bdf5c (diff) |
convert reiserfs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/reiserfs/inode.c')
-rw-r--r-- | fs/reiserfs/inode.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 46ba1cfc2df3..a94e08b339fc 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -25,7 +25,7 @@ int reiserfs_commit_write(struct file *f, struct page *page, | |||
25 | int reiserfs_prepare_write(struct file *f, struct page *page, | 25 | int reiserfs_prepare_write(struct file *f, struct page *page, |
26 | unsigned from, unsigned to); | 26 | unsigned from, unsigned to); |
27 | 27 | ||
28 | void reiserfs_delete_inode(struct inode *inode) | 28 | void reiserfs_evict_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 = | 31 | int jbegin_count = |
@@ -35,10 +35,12 @@ void reiserfs_delete_inode(struct inode *inode) | |||
35 | int depth; | 35 | int depth; |
36 | int err; | 36 | int err; |
37 | 37 | ||
38 | if (!is_bad_inode(inode)) | 38 | if (!inode->i_nlink && !is_bad_inode(inode)) |
39 | dquot_initialize(inode); | 39 | dquot_initialize(inode); |
40 | 40 | ||
41 | truncate_inode_pages(&inode->i_data, 0); | 41 | truncate_inode_pages(&inode->i_data, 0); |
42 | if (inode->i_nlink) | ||
43 | goto no_delete; | ||
42 | 44 | ||
43 | depth = reiserfs_write_lock_once(inode->i_sb); | 45 | depth = reiserfs_write_lock_once(inode->i_sb); |
44 | 46 | ||
@@ -77,9 +79,14 @@ void reiserfs_delete_inode(struct inode *inode) | |||
77 | ; | 79 | ; |
78 | } | 80 | } |
79 | out: | 81 | out: |
80 | clear_inode(inode); /* note this must go after the journal_end to prevent deadlock */ | 82 | end_writeback(inode); /* note this must go after the journal_end to prevent deadlock */ |
83 | dquot_drop(inode); | ||
81 | inode->i_blocks = 0; | 84 | inode->i_blocks = 0; |
82 | reiserfs_write_unlock_once(inode->i_sb, depth); | 85 | reiserfs_write_unlock_once(inode->i_sb, depth); |
86 | |||
87 | no_delete: | ||
88 | end_writeback(inode); | ||
89 | dquot_drop(inode); | ||
83 | } | 90 | } |
84 | 91 | ||
85 | static void _make_cpu_key(struct cpu_key *key, int version, __u32 dirid, | 92 | static void _make_cpu_key(struct cpu_key *key, int version, __u32 dirid, |