[7848] in linux-scsi channel archive
Re: [Question] rscsi_disks[].device being NULL
daemon@ATHENA.MIT.EDU (Alexander Viro)
Mon Jan 17 18:50:42 2000
Date: Mon, 17 Jan 2000 12:06:29 -0500 (EST)
From: Alexander Viro <viro@math.psu.edu>
To: Eric Youngdale <eric@andante.org>
Cc: Guest section DW <dwguest@win.tue.nl>,
Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-scsi@vger.rutgers.edu
In-Reply-To: <002101bf60f7$a5724020$2017a8c0@eric.home>
Message-ID: <Pine.GSO.4.10.10001171204510.10962-100000@weyl.math.psu.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Mon, 17 Jan 2000, Eric Youngdale wrote:
>
> > > > Eric, could you tell me what reads partition tables if we attach new
> disk
> > > > when system is already booted? sd_finish() via revalidate_scsidisk()?
> > >
> > > Exactly. At the bottom of revalidate_scsidisk, there is a call to
> > > resetup_one_dev(), which is the call into gendsk to tell it to read the
> >
> > Umm... What I'm trying to do is to figure out when should we create
> > disk_struct for SCSI disks. That is, instead of allocating gendisk in the
> > very beginning do register_disk()/unregister_disk() at right moments and
> > make replacement for resetup_one_dev() to take pointer to disk_struct
> > instead of bloody per-major stuff. Right now I'm doing it in the
> > sd_geninit() (explicitly called in the end of scsi_init()) and in the
> > branch of sd_finish() that used to be revalidate_scsidisk() (now it's
> > register_disk() preceded by sd_init_onedisk()). And freeing in
> > sd_detach()...
>
> I am tempted to think that sd_attach() might be a better place to hook
> in. The idea is that at the start we look to see if the device is of a type
> that the disk driver wants to handle, and then it snarfs an entry in
> rscsi_disks[]. Use that as something to key off of - when allocate the
> disk_struct when we reserve an entry in rscsi_disks[], and free it when we
> release it.
Right, but how soon after attach can we start accessing it? IOW, how bad
will be the attempt to read from it at the end of sd_attach()?
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu