]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: use the page cache for super block reading
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Thu, 13 Feb 2020 15:24:32 +0000 (00:24 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:39 +0000 (17:01 +0100)
commitfee492d0d5d0bbf15a64c47c2ed7f0f0dc8f599d
tree1315f1288db65939eda182fb9e3b0195b701f890
parentbb551dac9f934d35f32d5c50d51363d8c30656e7
btrfs: use the page cache for super block reading

Super-block reading in BTRFS is done using buffer_heads. Buffer_heads
have some drawbacks, like not being able to propagate errors from the
lower layers.

Directly use the page cache for reading the super blocks from disk or
invalidating an on-disk super block. We have to use the page cache so to
avoid races between mkfs and udev. See also b2180d4221f0 ("btrfs: access
superblock via pagecache in scan_one_device").

This patch unwraps the buffer head API and does not change the way the
super block is actually read.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/volumes.c
fs/btrfs/volumes.h