wrapper for access to ->bd_partno

On the next step it's going to get folded into a field where flags will go.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2024-04-12 01:01:36 -04:00
parent 3f9b8fb46e
commit b8c873edbf
4 changed files with 14 additions and 9 deletions
+6 -1
View File
@@ -720,6 +720,11 @@ void invalidate_disk(struct gendisk *disk);
void set_disk_ro(struct gendisk *disk, bool read_only);
void disk_uevent(struct gendisk *disk, enum kobject_action action);
static inline u8 bdev_partno(const struct block_device *bdev)
{
return bdev->bd_partno;
}
static inline int get_disk_ro(struct gendisk *disk)
{
return disk->part0->bd_read_only ||
@@ -1095,7 +1100,7 @@ static inline int sb_issue_zeroout(struct super_block *sb, sector_t block,
static inline bool bdev_is_partition(struct block_device *bdev)
{
return bdev->bd_partno;
return bdev_partno(bdev) != 0;
}
enum blk_default_limits {