linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luben Tuikov <luben_tuikov@adaptec.com>
To: dougg@torque.net
Cc: Jeff Garzik <jgarzik@pobox.com>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH RFC] use struct scsi_lun in generic code
Date: Mon, 24 Oct 2005 10:55:36 -0400	[thread overview]
Message-ID: <435CF5E8.5020702@adaptec.com> (raw)
In-Reply-To: <435B1E0E.8060409@torque.net>

On 10/23/05 01:22, Douglas Gilbert wrote:
>>A further experiment:  once dev_printk() has been used to eliminate
>>direct references to HCIL address (see previous patch), we can see what
>>happens when we update the core to use struct scsi_lun.
>>
>>DO NOT APPLY.
>>
>>Depends on previous "kill scsi_device::{channel,id} in generic code"
>>patch.
>>
>>Changes:
>>
>>* replace 'unsigned int lun' with 'struct scsi_lun lun' in struct scsi_device
>>
>>* change various function args to receive 'const struct scsi_lun *'
>>  rather than unsigned int.
>>
>>* export scsilun_to_int()
>>
>>* create scsilun_to_str() helper
>>
>>* create scsilun_eq() helper
>>
>>* update all references to scsi_device::lun, as caught by the compiler.
>>
>>  Again, generic code was 100% converted, driver code 0% converted.
>>
>>* int_to_scsilun() is used to convert SCSI-2 luns, and luns passed
>>  from userspace as integers, to struct scsi_lun.
>>
>>* shost->max_lun check moved into scsi_scan_host_selected() callers
> 
> 
> Jeff,
> With 8 byte luns, max_lun is legacy. I found it a nuisance

I agree.

Furthermore, a LUN is just u8[8] and I don't think there's a reason
to wrap that in a struct.  (Incidentally a logical unit number is
not a number but a structure.)

Other than application clients and device servers, I don't think
that the kernel should in anyway interpret the LUN structure.
It is just u8[8] and this is what the kernel should pass around.

Cf. drivers/scsi/sas/sas_discover.c and include/scsi/sas/sas_task.h.

	Luben
-- 
http://linux.adaptec.com/sas/
http://www.adaptec.com/sas/

  parent reply	other threads:[~2005-10-24 14:55 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-23  4:33 [PATCH RFC] use struct scsi_lun in generic code Jeff Garzik
2005-10-23  4:49 ` [PATCH RFC] more struct scsi_lun Jeff Garzik
2005-10-23  9:47   ` Stefan Richter
2005-10-23 13:14     ` Stefan Richter
2005-10-23 16:49       ` Jeff Garzik
2005-10-24 16:27         ` Luben Tuikov
2005-10-24 20:03           ` Stefan Richter
2005-10-24 20:10             ` Luben Tuikov
2005-10-24 20:28             ` Mark Rustad
2005-10-24 22:27             ` Douglas Gilbert
2005-10-23  5:20 ` [PATCH RFC] use struct scsi_lun in generic code Jeff Garzik
2005-10-23  5:22 ` Douglas Gilbert
2005-10-23  7:01   ` Jeff Garzik
2005-10-24 14:55   ` Luben Tuikov [this message]
2005-10-23  7:00 ` [PATCH RFC] yet more struct scsi_lun Jeff Garzik
2005-10-23 10:48   ` Douglas Gilbert
2005-10-23 11:53     ` Arjan van de Ven
2005-10-23 14:27       ` max_sectors [was Re: [PATCH RFC] yet more struct scsi_lun] Douglas Gilbert
2005-10-23 14:42         ` Arjan van de Ven
2005-10-23 16:44       ` [PATCH RFC] yet more struct scsi_lun Jeff Garzik
2005-10-23 16:43     ` Jeff Garzik
2005-10-23 18:53       ` Kai Makisara
2005-10-24  7:59       ` Jens Axboe
2005-10-28 17:24         ` Mike Christie
2005-10-31 10:24           ` Jens Axboe
2005-11-04  2:23             ` Mike Christie
2005-11-04  2:25               ` Mike Christie
2005-11-04  7:37               ` Jens Axboe
2005-11-04 17:27                 ` Mike Christie
2005-10-23  7:16 ` [PATCH RFC] even " Jeff Garzik
2005-10-24 15:27 ` [PATCH RFC] use struct scsi_lun in generic code Patrick Mansfield
2005-10-24 22:40   ` Douglas Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=435CF5E8.5020702@adaptec.com \
    --to=luben_tuikov@adaptec.com \
    --cc=dougg@torque.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).