Re: [PATCH] 2 of 2 - Allow O_EXCL on a block device to claim exclusive use.

From: Andries Brouwer
Date: Mon Aug 11 2003 - 22:00:20 EST


On Tue, Aug 12, 2003 at 11:48:28AM +1000, Neil Brown wrote:

> My first attempt at this did claim before openning.
> However that didn't work.
> Some aspects of the bdev that are needed for claiming are not
> initialised before it is first opened. In particular, bd_contains,
> gets set up by do_open.

Size and structure of partitions are entirely independent of whether
someone has opened them. Thus, the corresponding bookkeeping must
not be in struct block_device, which exists only when the device
is open, but in struct gendisk or so (and only there).

It is a design mistake to have such stuff in struct block device.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/