* [PATCH 2.6-mm] Fix 64-bit kdev_t /sys/<dev>/<partition>/dev format: %04x -> %u:%u
@ 2003-08-12 13:54 Christophe Saout
0 siblings, 0 replies; only message in thread
From: Christophe Saout @ 2003-08-12 13:54 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
Hi!
The 64-bit kdev_t patch forgot to change part_dev_read in
fs/partitions/check.c to return the device in the new %u:%u format in
sysfs.
cat /sys/block/hda/hda5/dev should return 3:5 instead of 0305
This small patch adds this:
diff -Nur linux.orig/fs/partitions/check.c linux/fs/partitions/check.c
--- linux.orig/fs/partitions/check.c 2003-08-12 15:27:55.000000000 +0200
+++ linux/fs/partitions/check.c 2003-08-12 15:46:15.855390848 +0200
@@ -223,9 +223,8 @@
static ssize_t part_dev_read(struct hd_struct * p, char *page)
{
struct gendisk *disk = container_of(p->kobj.parent,struct gendisk,kobj);
- int part = p->partno;
- dev_t base = MKDEV(disk->major, disk->first_minor);
- return sprintf(page, "%04x\n", (unsigned)(base + part));
+ dev_t dev = MKDEV(disk->major, disk->first_minor + p->partno);
+ return print_dev_t(page, dev);
}
static ssize_t part_start_read(struct hd_struct * p, char *page)
{
--
Christophe Saout <christophe@saout.de>
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-08-12 13:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-12 13:54 [PATCH 2.6-mm] Fix 64-bit kdev_t /sys/<dev>/<partition>/dev format: %04x -> %u:%u Christophe Saout
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).