From: Luben Tuikov <luben@splentec.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] SCSI Core cmd allocation 3/3
Date: Mon, 13 Jan 2003 12:12:09 -0500 [thread overview]
Message-ID: <3E22F369.5080209@splentec.com> (raw)
In-Reply-To: 20030111180355.B2225@infradead.org
Christoph Hellwig wrote:
>>struct scsi_cmnd * scsi_get_command(struct Scsi_Host *host, int alloc_flags);
>
>
> We only have two callers of this, one is scsi_getset_command and the other
> is used for allocating the freelist. For the latter most of the code in
> this function is superflous, it just needs the kmem_cache_alloc.
It will stay this way. This abstractizes the allocator; we were discussing
this some time ago, and another allocator could be put in, without disruption
to SCSI Core.
There may be more callers. SCSI Core just shows two callers, but other
subsystems/LLDD/ULDD may call it too. (There's a reason for this capability
which I cannot discuss right now -- queuing model will improve considerably, etc.)
> I'd suggest just using the kmem_cache_alloc directly for the freelist and
> merging it into your current scsi_getset_command. While at it the name
> scsi_get_command should be transfered to it also :)
scsi_get_command() was provided in the case when we don't know the device.
scsi_getset_command() was provided in the case when we know the device,
which is most of the time, for this reason it's inlined.
They will stay like so.
> I don't like the scsi_core_data concept. We don't need a struct for it as
> all variables not exported from scsi_mod.ko are the SCSI core data per
> defintion. Adding a struct container is just obsfucation.
No, it is NOT an obfuscation.
It's what object oriented paradigm (OOP) is all about.
struct scsi_core_data represents the SCSI Core subsystem. (Thing about this sentence
for a few seconds.) The structure was NOT set up in order to be ``exported''.
1) This is the wrong implication. 2) structs do not exist with the only purpose
to make visible their contents to the outside.
There's plenty of books on the object oriented paradigm.
It is my belief that such a struct will make things cleaner and clearer.
>
> Hmm, you seem to include some parts of the previous patch?
>
Justin didn't care to fix his stuff, even though I asked him politely,
so at the last moment I had to change this too.
> Your code wants some updates to match Documentation/CodingStyle.
All my inlines follow this style. Any other code of mine, in .c files
follows K&R style as it ever did, since my age of 14.
>>-EXPORT_SYMBOL(scsi_allocate_device);
>>+/* Obsolete! Use scsi_get_command() or scsi_getset_command(). */
>>+/* EXPORT_SYMBOL(scsi_allocate_device); */
>
>
> Just remove it. We have that comment and the code history in SCCS
> once it's applied.
Will do.
--
Luben
next prev parent reply other threads:[~2003-01-13 17:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-07 0:37 [PATCH] SCSI Core cmd allocation 3/3 Luben Tuikov
2003-01-11 18:03 ` Christoph Hellwig
2003-01-13 17:12 ` Luben Tuikov [this message]
2003-01-13 17:59 ` Christoph Hellwig
2003-01-13 19:16 ` Luben Tuikov
2003-01-13 20:11 ` Patrick Mansfield
2003-01-13 20:40 ` Luben Tuikov
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=3E22F369.5080209@splentec.com \
--to=luben@splentec.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox