aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/reiserfs/inode.c13
-rw-r--r--fs/reiserfs/super.c8
-rw-r--r--include/linux/reiserfs_fs.h2
3 files changed, 12 insertions, 11 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,
25int reiserfs_prepare_write(struct file *f, struct page *page, 25int reiserfs_prepare_write(struct file *f, struct page *page,
26 unsigned from, unsigned to); 26 unsigned from, unsigned to);
27 27
28void reiserfs_delete_inode(struct inode *inode) 28void 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
87no_delete:
88 end_writeback(inode);
89 dquot_drop(inode);
83} 90}
84 91
85static void _make_cpu_key(struct cpu_key *key, int version, __u32 dirid, 92static void _make_cpu_key(struct cpu_key *key, int version, __u32 dirid,
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 1e1ee9056eb6..e15ff612002d 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -591,11 +591,6 @@ out:
591 reiserfs_write_unlock_once(inode->i_sb, lock_depth); 591 reiserfs_write_unlock_once(inode->i_sb, lock_depth);
592} 592}
593 593
594static void reiserfs_clear_inode(struct inode *inode)
595{
596 dquot_drop(inode);
597}
598
599#ifdef CONFIG_QUOTA 594#ifdef CONFIG_QUOTA
600static ssize_t reiserfs_quota_write(struct super_block *, int, const char *, 595static ssize_t reiserfs_quota_write(struct super_block *, int, const char *,
601 size_t, loff_t); 596 size_t, loff_t);
@@ -608,8 +603,7 @@ static const struct super_operations reiserfs_sops = {
608 .destroy_inode = reiserfs_destroy_inode, 603 .destroy_inode = reiserfs_destroy_inode,
609 .write_inode = reiserfs_write_inode, 604 .write_inode = reiserfs_write_inode,
610 .dirty_inode = reiserfs_dirty_inode, 605 .dirty_inode = reiserfs_dirty_inode,
611 .clear_inode = reiserfs_clear_inode, 606 .evict_inode = reiserfs_evict_inode,
612 .delete_inode = reiserfs_delete_inode,
613 .put_super = reiserfs_put_super, 607 .put_super = reiserfs_put_super,
614 .write_super = reiserfs_write_super, 608 .write_super = reiserfs_write_super,
615 .sync_fs = reiserfs_sync_fs, 609 .sync_fs = reiserfs_sync_fs,
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 3b603f474186..2a464ae147ce 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -2033,7 +2033,7 @@ void reiserfs_read_locked_inode(struct inode *inode,
2033 struct reiserfs_iget_args *args); 2033 struct reiserfs_iget_args *args);
2034int reiserfs_find_actor(struct inode *inode, void *p); 2034int reiserfs_find_actor(struct inode *inode, void *p);
2035int reiserfs_init_locked_inode(struct inode *inode, void *p); 2035int reiserfs_init_locked_inode(struct inode *inode, void *p);
2036void reiserfs_delete_inode(struct inode *inode); 2036void reiserfs_evict_inode(struct inode *inode);
2037int reiserfs_write_inode(struct inode *inode, struct writeback_control *wbc); 2037int reiserfs_write_inode(struct inode *inode, struct writeback_control *wbc);
2038int reiserfs_get_block(struct inode *inode, sector_t block, 2038int reiserfs_get_block(struct inode *inode, sector_t block,
2039 struct buffer_head *bh_result, int create); 2039 struct buffer_head *bh_result, int create);