Commit 7ea448d5 authored by Christophe Saout's avatar Christophe Saout Committed by Linus Torvalds

[PATCH] Fix /sys/<dev>/<partition>/dev format: %04x -> %u:%u

A part of the 64 bit kdev_t patch already got merged, and it changes the
format of /sys/block/<dev>/dev from %02x%02x to %u:%u.  The partition
could must also be changed.

e.g. cat /sys/block/hda/hda5/dev should return 3:5 instead of 0305
parent 5c470bbf
...@@ -223,9 +223,8 @@ static struct sysfs_ops part_sysfs_ops = { ...@@ -223,9 +223,8 @@ static struct sysfs_ops part_sysfs_ops = {
static ssize_t part_dev_read(struct hd_struct * p, char *page) static ssize_t part_dev_read(struct hd_struct * p, char *page)
{ {
struct gendisk *disk = container_of(p->kobj.parent,struct gendisk,kobj); struct gendisk *disk = container_of(p->kobj.parent,struct gendisk,kobj);
int part = p->partno; dev_t dev = MKDEV(disk->major, disk->first_minor + p->partno);
dev_t base = MKDEV(disk->major, disk->first_minor); return print_dev_t(page, dev);
return sprintf(page, "%04x\n", (unsigned)(base + part));
} }
static ssize_t part_start_read(struct hd_struct * p, char *page) static ssize_t part_start_read(struct hd_struct * p, char *page)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment