mirror of
https://github.com/openwrt/openwrt.git
synced 2025-04-09 04:15:47 +00:00
kernel: remove custom partition name patch
Don't patch the kernel to expose the partition name in sysfs as it is already exposed via 'uevent'. All previous users have been converted to use 'uevent', so we can safely drop the custom patch. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
parent
d05eae9249
commit
b82a23e959
@ -73,42 +73,7 @@
|
||||
#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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user