diff options
| author | Christoph Hellwig <[email protected]> | 2020-11-17 08:18:55 +0100 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2020-12-01 14:53:39 -0700 |
| commit | 8d65269fe8065fee889bca5b204d711b0695a8f6 (patch) | |
| tree | 6444d7cdab2f4a9e63021188538f27b28396b8d4 /include/linux | |
| parent | 3f50b95e0edd22824b2650eb65466bf7060f7488 (diff) | |
block: add a bdev_kobj helper
Add a little helper to find the kobject for a struct block_device.
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Acked-by: Coly Li <[email protected]> [bcache]
Acked-by: David Sterba <[email protected]> [btrfs]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/blk_types.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index ebfb4e7c1fd1..9698f459cc65 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -49,6 +49,9 @@ struct block_device { struct super_block *bd_fsfreeze_sb; } __randomize_layout; +#define bdev_kobj(_bdev) \ + (&part_to_dev((_bdev)->bd_part)->kobj) + /* * Block error status values. See block/blk-core:blk_errors for the details. * Alpha cannot write a byte atomically, so we need to use 32-bit value. |