aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/dev-replace.c
diff options
context:
space:
mode:
authorAl Viro <[email protected]>2024-04-18 04:21:25 +0000
committerAl Viro <[email protected]>2024-05-02 21:39:44 +0000
commitb85c42981ac4abeeb15d16437c40f52a8a64787d (patch)
treeda3a99d999fedb54b571e9b7c96c2c6d1f714eb5 /fs/btrfs/dev-replace.c
parentswsusp: don't bother with setting block size (diff)
downloadkernel-b85c42981ac4abeeb15d16437c40f52a8a64787d.tar.gz
kernel-b85c42981ac4abeeb15d16437c40f52a8a64787d.zip
btrfs_get_bdev_and_sb(): call set_blocksize() only for exclusive opens
btrfs_get_bdev_and_sb() has two callers - btrfs_open_one_device(), which asks for open to be exclusive and btrfs_get_dev_args_from_path(), which doesn't. Currently it does set_blocksize() in all cases. I'm rather dubious about the need to do set_blocksize() anywhere in btrfs, to be honest - there's some access to page cache of underlying block devices in there, but it's nowhere near the hot paths, AFAICT. In any case, btrfs_get_dev_args_from_path() only needs to read the on-disk superblock and copy several fields out of it; all callers are only interested in devices that are already opened and brought into per-filesystem set, so setting the block size is redundant for those and actively harmful if we are given a pathname of unrelated device. So we only need btrfs_get_bdev_and_sb() to call set_blocksize() when it's asked to open exclusive. Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Christian Brauner <[email protected]> Signed-off-by: Al Viro <[email protected]>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions