public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] change of ->bd_op->open() semantics
@ 2002-05-24 20:12 Alexander Viro
  2002-05-24 20:25 ` Linus Torvalds
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Viro @ 2002-05-24 20:12 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Linus Torvalds, linux-kernel

	Folks, I propose to cache the result of blk_get_queue() in
struct block_device upon ->open().

	We already have struct block_device * whenever we are looking for
a queue.  So the only real problem arises if value of blk_get_queue()
changes while device is opened.  AFAICS nothing in the kernel pulls
such tricks (and to support them we would need to take care of a lot
of things, so changing the cached value wouldn't be a problem anyway).

	Yes, it means updating every instance of ->open() for block
devices.  All 30-odd of them.  I can do that in a single pass - changes
are trivial.

	It has an additional benefit of killing the array of default
queues on the same pass - a thing we will need to do sooner or later
anyway.

	Does anybody see a problem with that?


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [RFC] change of ->bd_op->open() semantics
@ 2002-05-25  0:24 Andries.Brouwer
  0 siblings, 0 replies; 6+ messages in thread
From: Andries.Brouwer @ 2002-05-25  0:24 UTC (permalink / raw)
  To: torvalds, viro; +Cc: axboe, linux-kernel

Al writes:

    4) moving the call of partition-reading code into do_open() (for cases when
    ->bd_contains is non-NULL), killing the "set block_device fields by hand"
    mess in check_partitions()

Hmm. I probably misunderstand some things.

There must be a data structure with the information that belongs
to a disk, opened or not. The size, the sectorsize, the partitions, ...
The structure that I made kdev_t point at.

What are you working towards? There is a struct block_device.
But it is not permanent. It is created when the device is opened
and disappears when it is closed.
So it doesnt help in replacing kdev_t - the permanent data must still
be somewhere. There is a struct gendisk. That is better.
It is not difficult to make sure that all devices that have array data
also get a struct gendisk.
Then there is struct request_queue. I see that it got hardsect_size,
but it seems a less suitable place for general disk info.

[So, let me repeat: Question: where do you plan to put permanent
disk data?]

Now about this partition-reading code. It requires a partitiontable type,
just like mounting requires a filesystem type. Now mount() has a
parameter that specifies the filesystem type. But open() does not
have a parameter that specifies a partitiontable type.
It seems to me that doing partitiontable reading in do_open()
is a really bad idea.

Maybe you have a "do it only once" kludge in mind?
To get something ugly, equivalent to the present situation?

Andries

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-05-25  0:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-24 20:12 [RFC] change of ->bd_op->open() semantics Alexander Viro
2002-05-24 20:25 ` Linus Torvalds
2002-05-24 21:15   ` Martin Dalecki
2002-05-24 22:47   ` Alexander Viro
2002-05-24 22:17     ` Martin Dalecki
  -- strict thread matches above, loose matches on Subject: below --
2002-05-25  0:24 Andries.Brouwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox