diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-06-08 18:11:48 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-06-08 18:11:48 -0400 |
commit | facda1e787d43191a3368c322f682054991c41b8 (patch) | |
tree | 53f64db2d80ee138adc997cccae979c87fd52a7b /fs/btrfs/disk-io.c | |
parent | 08607c1b182b3b8b54d7141a0c012cda17d201e6 (diff) |
Btrfs: get forced transaction commits via workqueue
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 048282f06afb..751069c0e9f5 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -563,6 +563,7 @@ struct btrfs_root *open_ctree(struct super_block *sb) | |||
563 | INIT_RADIX_TREE(&fs_info->block_group_radix, GFP_KERNEL); | 563 | INIT_RADIX_TREE(&fs_info->block_group_radix, GFP_KERNEL); |
564 | INIT_RADIX_TREE(&fs_info->block_group_data_radix, GFP_KERNEL); | 564 | INIT_RADIX_TREE(&fs_info->block_group_data_radix, GFP_KERNEL); |
565 | INIT_LIST_HEAD(&fs_info->trans_list); | 565 | INIT_LIST_HEAD(&fs_info->trans_list); |
566 | INIT_LIST_HEAD(&fs_info->dead_roots); | ||
566 | sb_set_blocksize(sb, 4096); | 567 | sb_set_blocksize(sb, 4096); |
567 | fs_info->running_transaction = NULL; | 568 | fs_info->running_transaction = NULL; |
568 | fs_info->tree_root = tree_root; | 569 | fs_info->tree_root = tree_root; |
@@ -577,6 +578,8 @@ struct btrfs_root *open_ctree(struct super_block *sb) | |||
577 | fs_info->do_barriers = 1; | 578 | fs_info->do_barriers = 1; |
578 | fs_info->extent_tree_insert_nr = 0; | 579 | fs_info->extent_tree_insert_nr = 0; |
579 | fs_info->extent_tree_prealloc_nr = 0; | 580 | fs_info->extent_tree_prealloc_nr = 0; |
581 | fs_info->closing = 0; | ||
582 | |||
580 | INIT_DELAYED_WORK(&fs_info->trans_work, btrfs_transaction_cleaner); | 583 | INIT_DELAYED_WORK(&fs_info->trans_work, btrfs_transaction_cleaner); |
581 | BTRFS_I(fs_info->btree_inode)->root = tree_root; | 584 | BTRFS_I(fs_info->btree_inode)->root = tree_root; |
582 | memset(&BTRFS_I(fs_info->btree_inode)->location, 0, | 585 | memset(&BTRFS_I(fs_info->btree_inode)->location, 0, |
@@ -746,6 +749,7 @@ int close_ctree(struct btrfs_root *root) | |||
746 | struct btrfs_trans_handle *trans; | 749 | struct btrfs_trans_handle *trans; |
747 | struct btrfs_fs_info *fs_info = root->fs_info; | 750 | struct btrfs_fs_info *fs_info = root->fs_info; |
748 | 751 | ||
752 | fs_info->closing = 1; | ||
749 | btrfs_transaction_flush_work(root); | 753 | btrfs_transaction_flush_work(root); |
750 | mutex_lock(&fs_info->fs_mutex); | 754 | mutex_lock(&fs_info->fs_mutex); |
751 | trans = btrfs_start_transaction(root, 1); | 755 | trans = btrfs_start_transaction(root, 1); |