From: Andreas Dilger <adilger@turbolabs.com>
To: Anton Altaparmakov <aia21@cus.cam.ac.uk>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Enhancement of /proc/partitions output (2.5.1-pre5)
Date: Sat, 1 Dec 2001 01:39:59 -0700 [thread overview]
Message-ID: <20011201013959.E27048@lynx.no> (raw)
In-Reply-To: <E16A4G6-0003bf-00@libra.cus.cam.ac.uk>
In-Reply-To: <E16A4G6-0003bf-00@libra.cus.cam.ac.uk>; from aia21@cus.cam.ac.uk on Sat, Dec 01, 2001 at 07:08:22AM +0000
On Dec 01, 2001 07:08 +0000, Anton Altaparmakov wrote:
> 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).
Please do not accept as-is. This breaks the format of /proc/partitions
terribly, and all of the code that looks at it (fsck, mount, etc). Rather
add the start_sect and nr_sects parameters _after_ the name parameter,
and it will be "mostly" ok.
While we are at it, how about adding the partition type to the output?
This is the only reason that I ever need to re-parse the on-disk crud
from DOS partition tables, and the kernel already handles it when it
is parsing the partition table. For the "partitions" that don't have
DOS-style partition types, we can either just put a string (like LVM
or MD) which may be useful for a variety of other reasons.
(Purely hand-edited version of Anton's patch changing it to have the
new fields at the end, may not apply, may not line up strings properly.
Doesn't include suggested parition type field either).
On a similar note - Linus, will you accept a patch which fixes the block
device naming, to make it a per driver issue, rather than embedding it
into the core code? I have one sitting around from way back, that has
been itching to get in.
Cheers, Andreas
============================================================================
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 %9s %-16s %10s %10s\n",
+ "#blocks", "name", "start_sect", "nr_sects");
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 %-16s %10lu %10lu\n",
gp->major, n, gp->sizes[n],
- disk_name(gp, n, buf));
+ disk_name(gp, n, buf),
+ gp->part[n].start_sect,
+ gp->part[n].nr_sects);
if (len < offset)
offset -= len, len = 0;
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
next prev parent reply other threads:[~2001-12-01 8:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-01 7:08 [PATCH] Enhancement of /proc/partitions output (2.5.1-pre5) Anton Altaparmakov
2001-12-01 8:39 ` Andreas Dilger [this message]
-- strict thread matches above, loose matches on Subject: below --
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=20011201013959.E27048@lynx.no \
--to=adilger@turbolabs.com \
--cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.