X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=block%2Fpartition-generic.c;h=ae95e963c5bb15df14a96b77a50c8a9302f23f53;hb=6014197ab14da9d1abd7b5911415c1dcb345169f;hp=3b030157ec85c45faedd520b6993cd440254d763;hpb=80e0c505b22e64ab1787285b182a1e8395e53991;p=firefly-linux-kernel-4.4.55.git diff --git a/block/partition-generic.c b/block/partition-generic.c index 3b030157ec85..ae95e963c5bb 100644 --- a/block/partition-generic.c +++ b/block/partition-generic.c @@ -216,10 +216,21 @@ static void part_release(struct device *dev) kfree(p); } +static int part_uevent(struct device *dev, struct kobj_uevent_env *env) +{ + struct hd_struct *part = dev_to_part(dev); + + add_uevent_var(env, "PARTN=%u", part->partno); + if (part->info && part->info->volname[0]) + add_uevent_var(env, "PARTNAME=%s", part->info->volname); + return 0; +} + struct device_type part_type = { .name = "partition", .groups = part_attr_groups, .release = part_release, + .uevent = part_uevent, }; static void delete_partition_rcu_cb(struct rcu_head *head) @@ -397,7 +408,7 @@ static int drop_partitions(struct gendisk *disk, struct block_device *bdev) struct hd_struct *part; int res; - if (bdev->bd_part_count) + if (bdev->bd_part_count || bdev->bd_super) return -EBUSY; res = invalidate_partition(disk, 0); if (res)