Re: [RFC] lazy allocation of struct block_device

Richard Gooch (rgooch@ras.ucalgary.ca)
Sun, 2 Sep 2001 10:16:41 -0600


Alexander Viro writes:
>
>
> On Sun, 2 Sep 2001, Richard Gooch wrote:
>
> > Yep. Having to allocate/search for a device structure during open(2)
> > is insane. It's wasteful. For ext2fs you can do it in lookup(), and
> > for devfs (or similar) you can do the ideal thing: when the device
> > entry is registered with the FS (i.e. only once).
>
> No. We _must_ do it on ->open() for cases when it had been NULL. Driver
> might be not there at ->lookup() time and hunting down all inodes with
> give major/minor is insanity.

Apologies. Let me clarify what I meant: it's insane to only ever
allow allocate/search during open(2).

Oh, and yeah: doing allocate/search during lookup() for ext2fs is a
bad idea. Wasn't thinking straight.

> Now, if inode had been created by the driver - sure, we create the
> association between it and <whatever>_device from the very
> beginning.

Yep. That's what I meant.

> We must support device nodes on normal filesystems.

Of course. No argument.

> Support for such beasts is there to stay. However, we shouldn't do
> things that make allocation of new majors mandatory. IOW, as far as
> I'm concerned solutions that do not allow "establish connection with
> foo_device upon inode creation and don't bother with device number
> for that one" are broken.

Nod.

Regards,

Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/