Kernel 6.6 from block_device how to get the superblock?
Prior to kernel 6.6, struct block_device had member variable:
Code:
struct super_block * bd_super; Code:
struct super_block *sb = bdev->bd_super; |
You can use
struct *super_block; sb = (struct super_block*)(bdev)->bd_holder in https://www.kernel.org/doc/html/v6.6...s/porting.html you can find that The holder of a block device is now the superblock. The holder of a block device used to be the file_system_type which wasn't particularly useful. It wasn't possible to go from block device to owning superblock without matching on the device pointer stored in the superblock. This mechanism would only work for a single device so the block layer couldn't find the owning superblock of any additional devices. |
All times are GMT -5. The time now is 01:53 AM. |