From: Benny Halevy <bhalevy@panasas.com>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: James.Bottomley@SteelEye.com, linux-scsi@vger.kernel.org,
hch@infradead.org
Subject: Re: [PATCH 1/19] add data buffer accessors
Date: Mon, 14 May 2007 11:13:52 +0300 [thread overview]
Message-ID: <46481A40.2040907@panasas.com> (raw)
In-Reply-To: <20070514170709R.fujita.tomonori@lab.ntt.co.jp>
FUJITA Tomonori wrote:
> From: Benny Halevy <bhalevy@panasas.com>
> Subject: Re: [PATCH 1/19] add data buffer accessors
> Date: Mon, 14 May 2007 10:57:08 +0300
>
>> FUJITA Tomonori wrote:
>>> +#define scsi_for_each_sg(cmd, sg, nseg, __i) \
>>> + for (__i = 0, sg = scsi_sglist(cmd); __i < (nseg); __i++, (sg)++)
>>> +
>> This feels like a layering violation, why not use for_each_sg()?
>>
>> +#define scsi_for_each_sg(cmd, sg, nseg, __i) \
>> for_each_sg(scsi_sglist(cmd), (sg), (nseg), (__i)) \
>
> As I said before, when for_each_sg is ready, we'll convert
> scsi_for_each_sg to use for_each_sg.
thanks. works for me.
>
>
>> That said, I'm not sure that scsi_for_each_sg() is worth abstracting
>> since the caller can just as well do for_each_sg() directly
>> as sketched above...
>
> I'm not sure why you think it's a layering violation.
I'd like to think of struct scatterlist as an abstract data type
with its own traversal method that hides its internals.
Not a layer per-se but more of an abstraction...
>
> With scsi_for_each_sg(), many drivers don't need scsi_sglist().
Sure, just my two cents...
prev parent reply other threads:[~2007-05-14 8:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-12 10:05 [PATCH 1/19] add data buffer accessors FUJITA Tomonori
2007-05-12 14:38 ` James Bottomley
2007-06-29 13:23 ` NPIV mapping problems (was Re: [PATCH 1/19] add data buffer accessors) Andrew Vasquez
2007-07-03 19:56 ` Seokmann Ju
2007-07-04 8:25 ` FUJITA Tomonori
2007-07-04 13:03 ` FUJITA Tomonori
2007-07-09 19:20 ` James Smart
2007-07-05 17:43 ` Seokmann Ju
2007-05-12 15:31 ` [PATCH 1/19] add data buffer accessors Christoph Hellwig
2007-05-13 3:30 ` FUJITA Tomonori
2007-05-13 14:04 ` Stefan Richter
2007-05-14 7:57 ` Benny Halevy
2007-05-14 8:07 ` FUJITA Tomonori
2007-05-14 8:13 ` Benny Halevy [this message]
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=46481A40.2040907@panasas.com \
--to=bhalevy@panasas.com \
--cc=James.Bottomley@SteelEye.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=hch@infradead.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.