]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: get rid of btrfs_read_dev_super()
authorQu Wenruo <wqu@suse.com>
Mon, 28 Apr 2025 00:46:19 +0000 (10:16 +0930)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:50 +0000 (14:30 +0200)
commit007fa63225683f540456a631045de681473d31d5
treeea2cc4c7a3be7723710fb3abbfa2f484f800a010
parent63f32b7b5d5a9107d04fb11cc85d5cd695f85e19
btrfs: get rid of btrfs_read_dev_super()

The function is introduced by commit a512bbf855ff ("Btrfs: superblock
duplication") at the beginning of btrfs.

It leaved a comment saying we'd need a special mount option to read all
super blocks, but it's never been implemented and there was not
need/request for it. The check/rescue tools are able to start from a
specific copy and use it as primary eventually.

This means btrfs_read_dev_super() is always reading the first super
block, making all the code finding the latest super block unnecessary.

Just remove that function and replace all call sites with
btrfs_read_disk_super(bdev, 0, false).

Signed-off-by: Qu Wenruo <wqu@suse.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