linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patches] rq_dev removal
@ 2002-10-31 22:43 Alexander Viro
  2002-10-31 22:57 ` James Bottomley
  2002-10-31 23:18 ` Willem Riede
  0 siblings, 2 replies; 6+ messages in thread
From: Alexander Viro @ 2002-10-31 22:43 UTC (permalink / raw)
  To: linux-scsi

	Folks, ->rq_dev is going away in 2.5 RSN.  The only non-trivial
remaining uses were in SCSI (scsi_lib.c::scsi_get_request_dev() and
uses in st.c, osst.c and sg.c to identify a device).

	Series of patches on ftp.math.psu.edu/pub/viro/P/P*-C45 deals
with that stuff and removes most of the uses of minor() in there.  Please,
review it.

	Contents:

	* osst.c and st.c get (inlined) helper functions - tape_name(STp).
Most of TAPE_NR() uses replaced with use of these animals.
	* osst.c and st.c ->open() puts pointer to Scsi_Tape into
filp->private_data, the same way as it's done by sg.c
	* sd.c and sr.c got a pointer to Scsi_Device_Template in
scsi_disk and scsi_cd resp.  That pointer is initialized to &s{d,r}_template.
disk->private_data points to that field (instead of entire scsi_disk/scsi_cd)
and old uses of disk->private_data are updated to compensate.
	* st.c, osst.c and sg.c got gendisks allocated, but not registered.
Places that set ->rq_dev set ->rq_disk as well.  Scsi_Tape and friends
got a pointer to Scsi_Device_Template (similar to sd/sr above) and
->private_data is set in similar fashion.  Users of ->rq_dev are using
->rq_disk->private_data now.

	* Now we can deal with scsi_get_request_dev().  Indeed, all places
that set ->rq_dev set ->rq_disk, and we are guaranteed that either
	+ ->rq_disk is NULL and ->rq_dev is 0
or
	+ ->rq_disk is non-NULL and
 *(struct Scsi_Device_Template **)rq->rq_disk->private_data
	  is the address of template in question.

In other words, scsi_get_request_dev() is two-liner now:

	struct gendisk *p = req->rq_disk;
	return p ? *(struct Scsi_Device_Template **)p->private_data : NULL;

and ->max_major, ->min_major and ->major from Scsi_Device_Template are
not used anymore (and thus can die).


	Please, review.  If somebody has objections - yell, otherwise this
stuff goes to Linus tomorrow.  Interesting things are in the small patches
- huge pair in the beginning of series is tape_name() stuff, i.e. purely
mechanical work.


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

end of thread, other threads:[~2002-11-01 14:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-31 22:43 [patches] rq_dev removal Alexander Viro
2002-10-31 22:57 ` James Bottomley
2002-10-31 23:18 ` Willem Riede
2002-10-31 23:40   ` Alexander Viro
2002-11-01  2:43   ` Douglas Gilbert
2002-11-01 14:05     ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).