提交 9d64272c 编写于 作者: C Chris Mason 提交者: David Woodhouse

Btrfs: don't wait on uptodate buffers on read

Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 2da566ed
......@@ -214,6 +214,8 @@ struct buffer_head *read_tree_block(struct btrfs_root *root, u64 blocknr)
bh = btrfs_find_create_tree_block(root, blocknr);
if (!bh)
return bh;
if (buffer_uptodate(bh))
goto uptodate;
lock_buffer(bh);
if (!buffer_uptodate(bh)) {
get_bh(bh);
......@@ -226,6 +228,7 @@ struct buffer_head *read_tree_block(struct btrfs_root *root, u64 blocknr)
} else {
unlock_buffer(bh);
}
uptodate:
if (check_tree_block(root, bh))
BUG();
return bh;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册