From: Anton Altaparmakov <aia21@cus.cam.ac.uk>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Enhancement of /proc/partitions output (2.5.1-pre5)
Date: Sat, 1 Dec 2001 07:08:22 +0000 (GMT) [thread overview]
Message-ID: <E16A4G6-0003bf-00@libra.cus.cam.ac.uk> (raw)
Linus,
Please consider below patch which adds the starting sector and number of
sectors to /proc/partitions.
It works fine here and I find having this information output can be very
useful (especially when the values in the kernel don't match the values
output by fdisk for example).
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/
diff -u -urN linux-2.5.1-pre5-vanilla/drivers/block/genhd.c l251p5/drivers/block/genhd.c
--- linux-2.5.1-pre5-vanilla/drivers/block/genhd.c Sat Dec 1 06:09:57 2001
+++ l251p5/drivers/block/genhd.c Sat Dec 1 03:57:57 2001
@@ -149,7 +149,8 @@
char buf[64];
int len, n;
- len = sprintf(page, "major minor #blocks name\n\n");
+ len = sprintf(page, "major minor #blocks start_sect nr_sects "
+ "name\n\n");
read_lock(&gendisk_lock);
for (gp = gendisk_head; gp; gp = gp->next) {
for (n = 0; n < (gp->nr_real << gp->minor_shift); n++) {
@@ -157,8 +158,10 @@
continue;
len += snprintf(page + len, 63,
- "%4d %4d %10d %s\n",
+ "%4d %4d %10d %10lu %10lu %s\n",
gp->major, n, gp->sizes[n],
+ gp->part[n].start_sect,
+ gp->part[n].nr_sects,
disk_name(gp, n, buf));
if (len < offset)
offset -= len, len = 0;
next reply other threads:[~2001-12-01 7:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-01 7:08 Anton Altaparmakov [this message]
2001-12-01 8:39 ` Andreas Dilger
2001-12-01 8:30 RaúlNúñez de Arenas Coronado
2001-12-01 8:47 ` Marcus Meissner
2001-12-01 16:10 ` Anton Altaparmakov
2001-12-01 11:22 Andries.Brouwer
2001-12-01 11:47 Andries.Brouwer
2001-12-01 16:07 ` Anton Altaparmakov
2001-12-01 20:51 ` Marcel J.E. Mol
2001-12-03 16:30 ` Bill Davidsen
2001-12-01 22:43 Andries.Brouwer
2001-12-02 2:13 ` Anton Altaparmakov
2001-12-02 3:28 Andries.Brouwer
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=E16A4G6-0003bf-00@libra.cus.cam.ac.uk \
--to=aia21@cus.cam.ac.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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
all inboxes | Powered by JetHome®