Re: [Patch] Cleanup struct gendisk registration, 2.3.40-pre1

From: Alexander Viro (aviro@redhat.com)
Date: Sat Jan 15 2000 - 02:54:16 EST


On Fri, 14 Jan 2000, Linus Torvalds wrote:

>
>
> On Sat, 15 Jan 2000, Alexander Viro wrote:
> >
> > Linus, your comments? I'ld rather do
> > drop_partitions() one as incremental to that...
>
> Hmm.. Looks ok to me, have you been able to test some SCSI and IDE
> cases with this?

IDE - yes. SCSI - not yet. I'll do it tomorrow - now I'm going down. Not
that it had a chance to appear on l-k before that, but... any help with
testing is very welcome, indeed.

> Also, I'm as big a fan of Stranger in a Strange Land as anybody else, but
> that doesn't really mean that I think "grok_partitions()" is necessarily
> the best name. How about just "parse_partitions()" or something, I don't
> think the code really meets the required level of intimate and consummate
> understanding of partitions to call it "grok"..

Well, there is a bloody simple reason - I'm going to change the type once
we'll get per-disk structure and grep for the remnants is the simplest way
to verify that all is converted ;-) Seriously, there are two cases when we
call this thing - one in ->revalidate() and BLKRRPART stuff and another
goes when we register disk. I'ld rather
        (a) have the variant that would take such structure and use it in
first kind of places. Call that parse_partitions().
        (b) have the function that would allocate a disk_struct (by device
numbers range, etc.) _and_ call parse_partitions(). Make that
register_disk(). This one should return the pointer to disk_struct, BTW.
        (c) Make ->revalidate() nice and simple - it's called only from
check_media_change(), so there we could check for device numbers range (if
== 1 - no partitions, nothing to drop), drop_partitions() if there is
something to drop, _then_ call ->revalidate() and if we have space for
partitions - call parse_partitions(). That is, for _all_ block devices
->revalidate() does only the driver-level work. Partitions are taken care
of in the VFS, where they make sense (ferchrissake, get_super() and
invalidate_inodes() in the driver!). Moreover, what way old MAYBE_REINIT
stuff will simply become ->revalidate() - that's what it apparently tried
to be.
                                                        Cheers,
                                                                Al

-
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/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:26 EST