diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-06 23:03:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-06 23:03:41 -0500 |
commit | 6a6662ced4153f6dbcfc40d7225c3cc45416039c (patch) | |
tree | 77ad5d577333f02cd854e44827a407dd0388d4eb /fs/btrfs/tree-log.c | |
parent | 32aaeffbd4a7457bf2f7448b33b5946ff2a960eb (diff) | |
parent | 7c7e82a77fe3d89ae50824aa7c897454675eb4c4 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (114 commits)
Btrfs: check for a null fs root when writing to the backup root log
Btrfs: fix race during transaction joins
Btrfs: fix a potential btrfs_bio leak on scrub fixups
Btrfs: rename btrfs_bio multi -> bbio for consistency
Btrfs: stop leaking btrfs_bios on readahead
Btrfs: stop the readahead threads on failed mount
Btrfs: fix extent_buffer leak in the metadata IO error handling
Btrfs: fix the new inspection ioctls for 32 bit compat
Btrfs: fix delayed insertion reservation
Btrfs: ClearPageError during writepage and clean_tree_block
Btrfs: be smarter about committing the transaction in reserve_metadata_bytes
Btrfs: make a delayed_block_rsv for the delayed item insertion
Btrfs: add a log of past tree roots
btrfs: separate superblock items out of fs_info
Btrfs: use the global reserve when truncating the free space cache inode
Btrfs: release metadata from global reserve if we have to fallback for unlink
Btrfs: make sure to flush queued bios if write_cache_pages waits
Btrfs: fix extent pinning bugs in the tree log
Btrfs: make sure btrfs_remove_free_space doesn't leak EAGAIN
Btrfs: don't wait as long for more batches during SSD log commit
...
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 0618aa39740b..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) |
@@ -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; |