Commit 9d64272c authored by Chris Mason's avatar Chris Mason Committed by David Woodhouse

Btrfs: don't wait on uptodate buffers on read

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 2da566ed
...@@ -214,6 +214,8 @@ struct buffer_head *read_tree_block(struct btrfs_root *root, u64 blocknr) ...@@ -214,6 +214,8 @@ struct buffer_head *read_tree_block(struct btrfs_root *root, u64 blocknr)
bh = btrfs_find_create_tree_block(root, blocknr); bh = btrfs_find_create_tree_block(root, blocknr);
if (!bh) if (!bh)
return bh; return bh;
if (buffer_uptodate(bh))
goto uptodate;
lock_buffer(bh); lock_buffer(bh);
if (!buffer_uptodate(bh)) { if (!buffer_uptodate(bh)) {
get_bh(bh); get_bh(bh);
...@@ -226,6 +228,7 @@ struct buffer_head *read_tree_block(struct btrfs_root *root, u64 blocknr) ...@@ -226,6 +228,7 @@ struct buffer_head *read_tree_block(struct btrfs_root *root, u64 blocknr)
} else { } else {
unlock_buffer(bh); unlock_buffer(bh);
} }
uptodate:
if (check_tree_block(root, bh)) if (check_tree_block(root, bh))
BUG(); BUG();
return bh; return bh;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment