#ifdef CONFIG_SGI_PARTITION
sgi_partition,
#endif
-@@ -215,6 +222,18 @@ static ssize_t part_discard_alignment_sh
- p->start_sect));
- }
-
-+static ssize_t part_name_show(struct device *dev,
-+ struct device_attribute *attr, char *buf)
-+{
-+ struct hd_struct *p = dev_to_part(dev);
-+
-+ if (p->info && p->info->volname)
-+ return sprintf(buf, "%s\n", p->info->volname);
-+
-+ buf[0] = '\0';
-+ return 0;
-+}
-+
- static DEVICE_ATTR(partition, 0444, part_partition_show, NULL);
- static DEVICE_ATTR(start, 0444, part_start_show, NULL);
- static DEVICE_ATTR(size, 0444, part_size_show, NULL);
-@@ -223,6 +242,7 @@ static DEVICE_ATTR(alignment_offset, 044
- static DEVICE_ATTR(discard_alignment, 0444, part_discard_alignment_show, NULL);
- static DEVICE_ATTR(stat, 0444, part_stat_show, NULL);
- static DEVICE_ATTR(inflight, 0444, part_inflight_show, NULL);
-+static DEVICE_ATTR(name, 0444, part_name_show, NULL);
- #ifdef CONFIG_FAIL_MAKE_REQUEST
- static struct device_attribute dev_attr_fail =
- __ATTR(make-it-fail, 0644, part_fail_show, part_fail_store);
-@@ -237,6 +257,7 @@ static struct attribute *part_attrs[] =
- &dev_attr_discard_alignment.attr,
- &dev_attr_stat.attr,
- &dev_attr_inflight.attr,
-+ &dev_attr_name.attr,
- #ifdef CONFIG_FAIL_MAKE_REQUEST
- &dev_attr_fail.attr,
- #endif
-@@ -694,6 +715,11 @@ static bool blk_add_partition(struct gen
+@@ -694,6 +701,11 @@ static bool blk_add_partition(struct gen
(state->parts[p].flags & ADDPART_FLAG_RAID))
md_autodetect_dev(part_to_dev(part)->devt);