btrfs: use fs_holder_ops for all opened devices
authorQu Wenruo <wqu@suse.com>
Thu, 19 Jun 2025 07:18:44 +0000 (16:48 +0930)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 22:06:20 +0000 (00:06 +0200)
commit08fa138864d54a2a93ad6fb1b681e7723ba26c9d
tree1c92a2cc14e4fe641f346239664b6b92b7d9ec79
parent40426dd147ffde7087dc29c263b87e1a2a36ca38
btrfs: use fs_holder_ops for all opened devices

Since we have btrfs_fs_info::sb (struct super_block) as our block device
holder, we can safely use fs_holder_ops for all of our block devices.

This enables freezing/thawing the filesystem from the underlying block
devices.

This may enhance hibernation/suspend support since previously
freezing/thawing a block device managed by btrfs won't do anything btrfs
specific, but only syncing the block device.

Thus before this change, freezing the underlying block devices won't
prevent future writes into the filesystem, thus may cause problems for
hibernation/suspend when btrfs is involved.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/dev-replace.c
fs/btrfs/volumes.c