Messages in this thread Patch in this message | | | From | "DoMiNo" <> | Subject | Two small patches | Date | Thu, 29 Jul 1999 17:47:28 +0200 |
| |
Here are two small patches. Both are also avaliable at http://www.uni-mb.si/~uel003r2a/proc-partitions.patch
The first one add the starting sectors and number of sectors field to the output of /proc/partitions. Handy if you overwrite your partition tables with garbage.
The second is a small simplification. Some should check it out.
Please CC any comments to my email : david.balazic@uni-mb.si
The patches :
diff -u -r linux-2.2.5-22-redhat/fs/buffer.c linux/fs/buffer.c --- linux-2.2.5-22-redhat/fs/buffer.c Wed Jun 2 14:36:14 1999 +++ linux/fs/buffer.c Thu Jul 29 12:52:39 1999 @@ -616,8 +616,12 @@ */ if (hardsect_size[MAJOR(dev)] != NULL) { int blksize = hardsect_size[MAJOR(dev)][MINOR(dev)]; - if (blksize != 0) - return blksize; +/* if (blksize != 0) + * this if() is redundant , as I see it. + * the blksize variable could be removed also, + * leaving only return gardsect_size[....] + */ + return blksize; }
/* diff -u -r linux-2.2.5-22-redhat/drivers/block/genhd.c linux/drivers/block/genhd.c --- linux-2.2.5-22-redhat/drivers/block/genhd.c Wed Jun 2 14:36:15 1999 +++ linux/drivers/block/genhd.c Thu Jul 29 00:54:24 1999 @@ -1427,14 +1427,17 @@ char buf[32]; int n, len;
- len = sprintf(page, "major minor #blocks name\n\n"); + len = sprintf(page, "major minor #blocks name start_sect nr_sects\n\n"); for (p = gendisk_head; p; p = p->next) { for (n=0; n < (p->nr_real << p->minor_shift); n++) { if (p->part[n].nr_sects && len < PAGE_SIZE - 80) { len += sprintf(page+len, - "%4d %4d %10d %s\n", + "%4d %4d %10d %6s %10ld %10ld\n", p->major, n, p->sizes[n], - disk_name(p, n, buf)); + disk_name(p, n, buf), + p->part[n].start_sect, + p->part[n].nr_sects + ); } } } ---- David Balazic
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |