Message ID | 20210224035830.990123-3-ming.lei@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | block: avoid to drop & re-add partitions if partitions aren't changed | expand |
diff --git a/block/partitions/core.c b/block/partitions/core.c index 430ff7863556..07981f663f66 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -352,6 +352,7 @@ static struct block_device *add_partition(struct gendisk *disk, int partno, bdev->bd_start_sect = start; bdev_set_nr_sectors(bdev, len); + bdev->bd_part_flags = flags; if (info) { err = -ENOMEM; diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index db026b6ec15a..4d43b80cb9e9 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -40,6 +40,7 @@ struct block_device { #endif struct kobject *bd_holder_dir; u8 bd_partno; + u8 bd_part_flags; /* number of times partitions within this device have been opened. */ unsigned bd_part_count;
Prepare for checking if partition is changed. Cc: Ewan Milne <emilne@redhat.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> --- block/partitions/core.c | 1 + include/linux/blk_types.h | 1 + 2 files changed, 2 insertions(+)