aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorYan, Zheng <zheng.yan@oracle.com>2009-11-12 04:36:34 -0500
committerChris Mason <chris.mason@oracle.com>2009-12-17 12:33:35 -0500
commit24bbcf0442ee04660a5a030efdbb6d03f1c275cb (patch)
treeaa57d77d29cc5150b272cc3f6465f10262fcbaac /fs/btrfs/ctree.h
parentf34f57a3ab4e73304d78c125682f1a53cd3975f2 (diff)
Btrfs: Add delayed iput
iput() can trigger new transactions if we are dropping the final reference, so calling it in btrfs_commit_transaction may end up deadlock. This patch adds delayed iput to avoid the issue. Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index a7cac2148c7c..1983c889bb1c 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -872,6 +872,9 @@ struct btrfs_fs_info {
872 struct list_head dead_roots; 872 struct list_head dead_roots;
873 struct list_head caching_block_groups; 873 struct list_head caching_block_groups;
874 874
875 spinlock_t delayed_iput_lock;
876 struct list_head delayed_iputs;
877
875 atomic_t nr_async_submits; 878 atomic_t nr_async_submits;
876 atomic_t async_submit_draining; 879 atomic_t async_submit_draining;
877 atomic_t nr_async_bios; 880 atomic_t nr_async_bios;
@@ -2301,7 +2304,7 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
2301 struct inode *inode, u64 new_size, 2304 struct inode *inode, u64 new_size,
2302 u32 min_type); 2305 u32 min_type);
2303 2306
2304int btrfs_start_delalloc_inodes(struct btrfs_root *root); 2307int btrfs_start_delalloc_inodes(struct btrfs_root *root, int delay_iput);
2305int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end); 2308int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end);
2306int btrfs_writepages(struct address_space *mapping, 2309int btrfs_writepages(struct address_space *mapping,
2307 struct writeback_control *wbc); 2310 struct writeback_control *wbc);
@@ -2341,6 +2344,8 @@ int btrfs_orphan_del(struct btrfs_trans_handle *trans, struct inode *inode);
2341void btrfs_orphan_cleanup(struct btrfs_root *root); 2344void btrfs_orphan_cleanup(struct btrfs_root *root);
2342int btrfs_cont_expand(struct inode *inode, loff_t size); 2345int btrfs_cont_expand(struct inode *inode, loff_t size);
2343int btrfs_invalidate_inodes(struct btrfs_root *root); 2346int btrfs_invalidate_inodes(struct btrfs_root *root);
2347void btrfs_add_delayed_iput(struct inode *inode);
2348void btrfs_run_delayed_iputs(struct btrfs_root *root);
2344extern const struct dentry_operations btrfs_dentry_operations; 2349extern const struct dentry_operations btrfs_dentry_operations;
2345 2350
2346/* ioctl.c */ 2351/* ioctl.c */