aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/delayed-inode.c18
-rw-r--r--fs/btrfs/delayed-inode.h3
-rw-r--r--fs/btrfs/disk-io.c6
3 files changed, 27 insertions, 0 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index c18d0442ae6d..2399f4086915 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -1879,3 +1879,21 @@ void btrfs_kill_all_delayed_nodes(struct btrfs_root *root)
1879 } 1879 }
1880 } 1880 }
1881} 1881}
1882
1883void btrfs_destroy_delayed_inodes(struct btrfs_root *root)
1884{
1885 struct btrfs_delayed_root *delayed_root;
1886 struct btrfs_delayed_node *curr_node, *prev_node;
1887
1888 delayed_root = btrfs_get_delayed_root(root);
1889
1890 curr_node = btrfs_first_delayed_node(delayed_root);
1891 while (curr_node) {
1892 __btrfs_kill_delayed_node(curr_node);
1893
1894 prev_node = curr_node;
1895 curr_node = btrfs_next_delayed_node(curr_node);
1896 btrfs_release_delayed_node(prev_node);
1897 }
1898}
1899
diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h
index 7083d08b2a21..f5aa4023d3e1 100644
--- a/fs/btrfs/delayed-inode.h
+++ b/fs/btrfs/delayed-inode.h
@@ -124,6 +124,9 @@ int btrfs_fill_inode(struct inode *inode, u32 *rdev);
124/* Used for drop dead root */ 124/* Used for drop dead root */
125void btrfs_kill_all_delayed_nodes(struct btrfs_root *root); 125void btrfs_kill_all_delayed_nodes(struct btrfs_root *root);
126 126
127/* Used for clean the transaction */
128void btrfs_destroy_delayed_inodes(struct btrfs_root *root);
129
127/* Used for readdir() */ 130/* Used for readdir() */
128void btrfs_get_delayed_items(struct inode *inode, struct list_head *ins_list, 131void btrfs_get_delayed_items(struct inode *inode, struct list_head *ins_list,
129 struct list_head *del_list); 132 struct list_head *del_list);
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index ffdd76bf05d4..e22c5bbf0223 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3608,6 +3608,9 @@ void btrfs_cleanup_one_transaction(struct btrfs_transaction *cur_trans,
3608 cur_trans->commit_done = 1; 3608 cur_trans->commit_done = 1;
3609 wake_up(&cur_trans->commit_wait); 3609 wake_up(&cur_trans->commit_wait);
3610 3610
3611 btrfs_destroy_delayed_inodes(root);
3612 btrfs_assert_delayed_root_empty(root);
3613
3611 btrfs_destroy_pending_snapshots(cur_trans); 3614 btrfs_destroy_pending_snapshots(cur_trans);
3612 3615
3613 btrfs_destroy_marked_extents(root, &cur_trans->dirty_pages, 3616 btrfs_destroy_marked_extents(root, &cur_trans->dirty_pages,
@@ -3662,6 +3665,9 @@ int btrfs_cleanup_transaction(struct btrfs_root *root)
3662 if (waitqueue_active(&t->commit_wait)) 3665 if (waitqueue_active(&t->commit_wait))
3663 wake_up(&t->commit_wait); 3666 wake_up(&t->commit_wait);
3664 3667
3668 btrfs_destroy_delayed_inodes(root);
3669 btrfs_assert_delayed_root_empty(root);
3670
3665 btrfs_destroy_pending_snapshots(t); 3671 btrfs_destroy_pending_snapshots(t);
3666 3672
3667 btrfs_destroy_delalloc_inodes(root); 3673 btrfs_destroy_delalloc_inodes(root);