[lkml]   [2001]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] struct char_device
And if we are at the topic... Those are the places where blk_size[]
abused, since it's in fact a property of a FS in fact and not the
property of
a particular device... blksect_size is the array describing the physical
access limits of a device and blk_size get's usually checked against it.
However due to the bad naming and the fact that this information is
associated with major/minor number usage same device driver writers got
*very* confused as you can see below:

./fs/block_dev.c: Here this information should be passed entierly insice
the request.

./fs/partitions/check.c: Here it basically get's reset or ignored

Here it's serving the purpose of a sector size, which is bogous!

./mm/swapfile.c:#include <linux/blkdev.h> /* for blk_size */
./mm/swapfile.c: if (!dev || (blk_size[MAJOR(dev)] &&
./mm/swapfile.c: !blk_size[MAJOR(dev)][MINOR(dev)]))
./mm/swapfile.c: if (blk_size[MAJOR(dev)])
./mm/swapfile.c: swapfilesize = blk_size[MAJOR(dev)][MINOR(dev)]

Here it shouldn't be needed

./drivers/block/floppy.c: blk_size[MAJOR_NR] = floppy_sizes;
./drivers/block/nbd.c: blk_size[MAJOR_NR] = nbd_sizes;
./drivers/block/rd.c: * and set blk_size for -ENOSPC, Werner Fink
<>, Apr '99
./drivers/block/amiflop.c: blk_size[MAJOR_NR] = floppy_sizes;
./drivers/block/loop.c: if (blk_size[MAJOR(lodev)])
./drivers/block/ataflop.c: * - Set blk_size for proper size checking
./drivers/block/ataflop.c: blk_size[MAJOR_NR] = floppy_sizes;
./drivers/block/cpqarray.c: drv->blk_size;
./drivers/block/z2ram.c: blk_size[ MAJOR_NR ] = z2_sizes;
./drivers/block/swim3.c: blk_size[MAJOR_NR] = floppy_sizes;
./drivers/block/swim_iop.c: blk_size[MAJOR_NR] = floppy_sizes;
./drivers/char/raw.c: if (blk_size[MAJOR(dev)])
./drivers/scsi/advansys.c: ASC_DCNT blk_size;
./drivers/scsi/sd.c: blk_size[SD_MAJOR(i)] = NULL;
./drivers/scsi/sr.c: blk_size[MAJOR_NR] = sr_sizes;
./drivers/scsi/sr.c: blk_size[MAJOR_NR] = NULL;
./drivers/sbus/char/jsflash.c: blk_size[JSFD_MAJOR] = jsfd_sizes;
./drivers/ide/ide-cd.c: blk_size[HWIF(drive)->major] =
./drivers/ide/ide-floppy.c: * Revalidate the new media. Should set
./drivers/acorn/block/fd1772.c: blk_size[MAJOR_NR] = floppy_sizes;
./drivers/i2o/i2o_block.c: blk_size[MAJOR_NR] = i2ob_sizes;

In the following they are REALLY confusing it and then compensating for
this misunderstanding in lvm.h by redefining the corresponding default


And then some minor confusions follow...

./drivers/mtd/mtdblock.c: blk_size[MAJOR_NR] = NULL;
./drivers/md/md.c: if (blk_size[MAJOR(dev)])
./arch/m68k/atari/stram.c: blk_size[STRAM_MAJOR] = stram_sizes;

Basically one should just stop setting blk_size[][] inside *ANY* driver
and anything should still work fine unless the driver is broken...

Well that's the point for another fine kernel experiment I will do
and report whatever it works really out like this in reality 8-)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:53    [W:0.048 / U:8.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site