public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: PATCH 2.5.2-pre9 scsi cleanup
@ 2002-01-09  5:01 Douglas Gilbert
  2002-01-09  9:28 ` Martin Dalecki
  0 siblings, 1 reply; 8+ messages in thread
From: Douglas Gilbert @ 2002-01-09  5:01 UTC (permalink / raw)
  To: Martin Dalecki; +Cc: linux-kernel

Martin Dalecki <dalecki@evision-ventures.com>

> The attached patch does the following.
> 
> 1. Clean up some ifdef confusion in do_mount
> 
> 2. Clean up the scsi code to make ppa.c work.
> 
> 3. Clean up some unneccessary unneeded globals from scsi code.
> 
> 4. Make a bit more sure, that the minor() and friends end up in
> unsigned int's.

<snip/>

Martin,
Please don't post a omnibus SCSI subsystem patch like this.

Most of the code you are changing is actively maintained.
For example:
  - scsi mid-level + sr [Jens Axboe]
  - ppa [Tim Waugh]
  - sg  [me]

Some of us have grown attached to the way 'cat /proc/scsi/scsi'
looks. More importantly, many distributions have scripts that
parse it. GOTO Masanori's <gotom@debian.or.jp> suggestion of
of an exported scsi_device_types() seems a better option.
Also there are 32 SCSI device types (0 to 31) and perhaps
the "unknown"s and those that are missing could be replaced
by scsi_dev_<n> .

Also there is an appropriate newsgroup for this sort of
proposal and it is called: linux-scsi@vger.kernel.org

Doug Gilbert

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: PATCH 2.5.2-pre9 scsi cleanup
@ 2002-01-08 17:19 Cameron, Steve
  2002-01-08 18:43 ` Martin Dalecki
  0 siblings, 1 reply; 8+ messages in thread
From: Cameron, Steve @ 2002-01-08 17:19 UTC (permalink / raw)
  To: Martin Dalecki; +Cc: linux-kernel, White, Charles

Martin Dalecki [mailto:dalecki@evision-ventures.com] wrote,
regarding removal of scsi_device_types[] from drivers/scsi/scsi.c

> Cameron, Steve wrote:
[...]
> >Hmmm, I was using that.... (In, for example, 
> >the cciss patch here: http://www.geocities.com/smcameron 
> >It's not any big deal, though.)
> >
> Precisely this "not any big deal" is the point: It was the wrong 
> approach to a trivial problem ;-).

So what's the right approach?  I can invent my own easily enough, 
but each driver doing its own thing doesn't seem right.  I assumed 
that it was in scsi.c foi common usage, so each driver that wanted 
to say, use these device type strings in diagnostic messages or 
some such wouldn't have to reinvent this wheel, and so all the 
drivers would consistently use the same names.  Will it be 
replaced with something else?

Just want to know so I don't waste (even more :-) time 
doing something dumb.

Thanks,

-- steve

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: PATCH 2.5.2-pre9 scsi cleanup
@ 2002-01-08 16:15 Cameron, Steve
  2002-01-08 16:43 ` Martin Dalecki
  0 siblings, 1 reply; 8+ messages in thread
From: Cameron, Steve @ 2002-01-08 16:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: dalecki, White, Charles

Martin Dalecki (dalecki@evision-ventures.com) wrote:

[...]
> --- linux-old/drivers/scsi/scsi.c	Sat May  4 09:11:44 2002
> +++ linux/drivers/scsi/scsi.c	Sat May  4 07:49:19 2002
> @@ -139,25 +139,7 @@
>   */
>  unsigned int scsi_logging_level;
>  
> -const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE] =
> -{
> -	"Direct-Access    ",
> -	"Sequential-Access",
> -	"Printer          ",
> -	"Processor        ",
> -	"WORM             ",
> -	"CD-ROM           ",
> -	"Scanner          ",
[...etc...]

Hmmm, I was using that.... (In, for example, 
the cciss patch here: http://www.geocities.com/smcameron 
It's not any big deal, though.)

-- steve

^ permalink raw reply	[flat|nested] 8+ messages in thread
* NFS "dev_t" issues..
@ 2002-01-01 22:15 Linus Torvalds
  2002-01-08  9:29 ` PATCH 2.5.2-pre9 scsi cleanup Martin Dalecki
  0 siblings, 1 reply; 8+ messages in thread
From: Linus Torvalds @ 2002-01-01 22:15 UTC (permalink / raw)
  To: Trond Myklebust, Neil Brown; +Cc: Kernel Mailing List, Marcelo Tosatti


I made a pre6, which contains a new-and-anal "kdev_t".

The format of the thing is the same as it used to be, ie 16 bits of
information, but I made it a structure so that you _couldn't_ mix up
"dev_t" and "kdev_t", or use the "kdev_t" as a number (so when kdev_t
expands to 12+20 bits later in 2.5.x you shouldn't get surprises)

I fixed up the stuff I use and which showed up in compiles (on a source
level, it's so far totally untested), but I'd really like people to check
out their own subsystems. _Especially_ NFS and NFSD, which had several
cases of mixing the two dev_t's around, and which also used them as
numbers. Trond, Neil?

Because the types aren't at all compatible any more, the macros that are
used for user-level "dev_t" are no longer working for a kdev_t. So we have

	dev_t			kdev_t

	MKDEV(major,minor)	mk_kdev(major, minor)
	MAJOR(dev)		major(dev)
	MINOR(dev)		minor(dev)
	dev == dev2		kdev_same(dev, dev2)
	!dev			kdev_none(dev)

and _most_ of the time the fixes are trivial - just translate as above. It
only gets interesting when you have code that looks at the value or starts
mixing the two and compares a "dev_t" against a "kdev_t", which can be
quite interesting.

The knfsd file handle thing is also an issue - Neil, please check out that
what I did looks sane, and would be on-the-wire-compatible with the old
behaviour, even when we expand kdev_t to 12+20 bits, ok?

(Marcelo, for easier backporting of drivers to 2.4.x, we'll probably want
to eventually add

	#define mk_kdev(a,b) MKDEV(a,b)
	#define major(d) MAJOR(d)
	...

to the 2.4.x <linux/kdev_t.h> so that you can move drivers back and
forth).

Apart from some knfsd issues, most of the kdev_t users were proper. The
strict type-checking found one bug in the SCSI layer (which I knew about,
and was one of the impetuses for doing it in the first place), and found a
lot of small "works-but-will-break-with-a-bigger-kdev_t" issues).

			Linus


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

end of thread, other threads:[~2002-01-09  9:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-09  5:01 PATCH 2.5.2-pre9 scsi cleanup Douglas Gilbert
2002-01-09  9:28 ` Martin Dalecki
  -- strict thread matches above, loose matches on Subject: below --
2002-01-08 17:19 Cameron, Steve
2002-01-08 18:43 ` Martin Dalecki
2002-01-08 16:15 Cameron, Steve
2002-01-08 16:43 ` Martin Dalecki
2002-01-01 22:15 NFS "dev_t" issues Linus Torvalds
2002-01-08  9:29 ` PATCH 2.5.2-pre9 scsi cleanup Martin Dalecki
2002-01-09  4:05   ` GOTO Masanori

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