linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Saout <christophe@saout.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Fix /sys/<dev>/<partition>/dev format: %04x -> %u:%u
Date: Tue, 12 Aug 2003 17:30:46 +0200	[thread overview]
Message-ID: <20030812153046.GA13568@chtephan.cs.pocnet.net> (raw)

Hi!

(I already sent a patch to Andrew, but someone just told me that the
vanilla test3 is also affected)

In 2.6.0-test3 a part of the 64 bit kdev_t patch got merged, 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

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

                 reply	other threads:[~2003-08-12 15:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030812153046.GA13568@chtephan.cs.pocnet.net \
    --to=christophe@saout.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).