aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-06-07 13:43:19 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-09 16:48:35 -0400
commit45321ac54316eaeeebde0b5f728a1791e500974c (patch)
treec3989dd1a8b4a50168d696aa608941de88da9ade /fs/btrfs
parent30140837f256558c943636245ab90897a9455a70 (diff)
Make ->drop_inode() just return whether inode needs to be dropped
... and let iput_final() do the actual eviction or retention Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/ctree.h2
-rw-r--r--fs/btrfs/inode.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 394d5422ab6a..eaf286abad17 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2395,7 +2395,7 @@ int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc);
2395void btrfs_dirty_inode(struct inode *inode); 2395void btrfs_dirty_inode(struct inode *inode);
2396struct inode *btrfs_alloc_inode(struct super_block *sb); 2396struct inode *btrfs_alloc_inode(struct super_block *sb);
2397void btrfs_destroy_inode(struct inode *inode); 2397void btrfs_destroy_inode(struct inode *inode);
2398void btrfs_drop_inode(struct inode *inode); 2398int btrfs_drop_inode(struct inode *inode);
2399int btrfs_init_cachep(void); 2399int btrfs_init_cachep(void);
2400void btrfs_destroy_cachep(void); 2400void btrfs_destroy_cachep(void);
2401long btrfs_ioctl_trans_end(struct file *file); 2401long btrfs_ioctl_trans_end(struct file *file);
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index ce02199ec4e5..2c54f04a0bf5 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3943,7 +3943,7 @@ again:
3943 if (atomic_read(&inode->i_count) > 1) 3943 if (atomic_read(&inode->i_count) > 1)
3944 d_prune_aliases(inode); 3944 d_prune_aliases(inode);
3945 /* 3945 /*
3946 * btrfs_drop_inode will remove it from 3946 * btrfs_drop_inode will have it removed from
3947 * the inode cache when its usage count 3947 * the inode cache when its usage count
3948 * hits zero. 3948 * hits zero.
3949 */ 3949 */
@@ -6337,13 +6337,14 @@ free:
6337 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); 6337 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode));
6338} 6338}
6339 6339
6340void btrfs_drop_inode(struct inode *inode) 6340int btrfs_drop_inode(struct inode *inode)
6341{ 6341{
6342 struct btrfs_root *root = BTRFS_I(inode)->root; 6342 struct btrfs_root *root = BTRFS_I(inode)->root;
6343 if (inode->i_nlink > 0 && btrfs_root_refs(&root->root_item) == 0) 6343
6344 generic_delete_inode(inode); 6344 if (btrfs_root_refs(&root->root_item) == 0)
6345 return 1;
6345 else 6346 else
6346 generic_drop_inode(inode); 6347 return generic_drop_inode(inode);
6347} 6348}
6348 6349
6349static void init_once(void *foo) 6350static void init_once(void *foo)