diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-01-09 02:38:23 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-01-09 02:38:23 -0500 |
commit | da733563be5a9da26fe81d9f007262d00b846e22 (patch) | |
tree | db28291df94a2043af2123911984c5c173da4e6f /fs/btrfs/tree-log.c | |
parent | 6ccbcf2cb41131f8d56ef0723bf3f7c1f8486076 (diff) | |
parent | dab78d7924598ea4031663dd10db814e2e324928 (diff) |
Merge branch 'next' into for-linus
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 786639fca067..3568374d419d 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -276,8 +276,9 @@ static int process_one_buffer(struct btrfs_root *log, | |||
276 | struct walk_control *wc, u64 gen) | 276 | struct walk_control *wc, u64 gen) |
277 | { | 277 | { |
278 | if (wc->pin) | 278 | if (wc->pin) |
279 | btrfs_pin_extent(log->fs_info->extent_root, | 279 | btrfs_pin_extent_for_log_replay(wc->trans, |
280 | eb->start, eb->len, 0); | 280 | log->fs_info->extent_root, |
281 | eb->start, eb->len); | ||
281 | 282 | ||
282 | if (btrfs_buffer_uptodate(eb, gen)) { | 283 | if (btrfs_buffer_uptodate(eb, gen)) { |
283 | if (wc->write) | 284 | if (wc->write) |
@@ -1030,7 +1031,7 @@ static noinline int fixup_inode_link_count(struct btrfs_trans_handle *trans, | |||
1030 | } | 1031 | } |
1031 | btrfs_release_path(path); | 1032 | btrfs_release_path(path); |
1032 | if (nlink != inode->i_nlink) { | 1033 | if (nlink != inode->i_nlink) { |
1033 | inode->i_nlink = nlink; | 1034 | set_nlink(inode, nlink); |
1034 | btrfs_update_inode(trans, root, inode); | 1035 | btrfs_update_inode(trans, root, inode); |
1035 | } | 1036 | } |
1036 | BTRFS_I(inode)->index_cnt = (u64)-1; | 1037 | BTRFS_I(inode)->index_cnt = (u64)-1; |
@@ -1760,7 +1761,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans, | |||
1760 | 1761 | ||
1761 | WARN_ON(root_owner != | 1762 | WARN_ON(root_owner != |
1762 | BTRFS_TREE_LOG_OBJECTID); | 1763 | BTRFS_TREE_LOG_OBJECTID); |
1763 | ret = btrfs_free_reserved_extent(root, | 1764 | ret = btrfs_free_and_pin_reserved_extent(root, |
1764 | bytenr, blocksize); | 1765 | bytenr, blocksize); |
1765 | BUG_ON(ret); | 1766 | BUG_ON(ret); |
1766 | } | 1767 | } |
@@ -1828,7 +1829,7 @@ static noinline int walk_up_log_tree(struct btrfs_trans_handle *trans, | |||
1828 | btrfs_tree_unlock(next); | 1829 | btrfs_tree_unlock(next); |
1829 | 1830 | ||
1830 | WARN_ON(root_owner != BTRFS_TREE_LOG_OBJECTID); | 1831 | WARN_ON(root_owner != BTRFS_TREE_LOG_OBJECTID); |
1831 | ret = btrfs_free_reserved_extent(root, | 1832 | ret = btrfs_free_and_pin_reserved_extent(root, |
1832 | path->nodes[*level]->start, | 1833 | path->nodes[*level]->start, |
1833 | path->nodes[*level]->len); | 1834 | path->nodes[*level]->len); |
1834 | BUG_ON(ret); | 1835 | BUG_ON(ret); |
@@ -1897,7 +1898,7 @@ static int walk_log_tree(struct btrfs_trans_handle *trans, | |||
1897 | 1898 | ||
1898 | WARN_ON(log->root_key.objectid != | 1899 | WARN_ON(log->root_key.objectid != |
1899 | BTRFS_TREE_LOG_OBJECTID); | 1900 | BTRFS_TREE_LOG_OBJECTID); |
1900 | ret = btrfs_free_reserved_extent(log, next->start, | 1901 | ret = btrfs_free_and_pin_reserved_extent(log, next->start, |
1901 | next->len); | 1902 | next->len); |
1902 | BUG_ON(ret); | 1903 | BUG_ON(ret); |
1903 | } | 1904 | } |
@@ -2013,10 +2014,10 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, | |||
2013 | /* wait for previous tree log sync to complete */ | 2014 | /* wait for previous tree log sync to complete */ |
2014 | if (atomic_read(&root->log_commit[(index1 + 1) % 2])) | 2015 | if (atomic_read(&root->log_commit[(index1 + 1) % 2])) |
2015 | wait_log_commit(trans, root, root->log_transid - 1); | 2016 | wait_log_commit(trans, root, root->log_transid - 1); |
2016 | |||
2017 | while (1) { | 2017 | while (1) { |
2018 | unsigned long batch = root->log_batch; | 2018 | unsigned long batch = root->log_batch; |
2019 | if (root->log_multiple_pids) { | 2019 | /* when we're on an ssd, just kick the log commit out */ |
2020 | if (!btrfs_test_opt(root, SSD) && root->log_multiple_pids) { | ||
2020 | mutex_unlock(&root->log_mutex); | 2021 | mutex_unlock(&root->log_mutex); |
2021 | schedule_timeout_uninterruptible(1); | 2022 | schedule_timeout_uninterruptible(1); |
2022 | mutex_lock(&root->log_mutex); | 2023 | mutex_lock(&root->log_mutex); |
@@ -2117,9 +2118,9 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, | |||
2117 | BUG_ON(ret); | 2118 | BUG_ON(ret); |
2118 | btrfs_wait_marked_extents(log, &log->dirty_log_pages, mark); | 2119 | btrfs_wait_marked_extents(log, &log->dirty_log_pages, mark); |
2119 | 2120 | ||
2120 | btrfs_set_super_log_root(&root->fs_info->super_for_commit, | 2121 | btrfs_set_super_log_root(root->fs_info->super_for_commit, |
2121 | log_root_tree->node->start); | 2122 | log_root_tree->node->start); |
2122 | btrfs_set_super_log_root_level(&root->fs_info->super_for_commit, | 2123 | btrfs_set_super_log_root_level(root->fs_info->super_for_commit, |
2123 | btrfs_header_level(log_root_tree->node)); | 2124 | btrfs_header_level(log_root_tree->node)); |
2124 | 2125 | ||
2125 | log_root_tree->log_batch = 0; | 2126 | log_root_tree->log_batch = 0; |