From: Christoph Hellwig <hch@lst.de>
To: Luben Tuikov <tluben@rogers.com>
Cc: James.Bottomley@steeleye.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] introduce scsi_host_alloc
Date: Fri, 6 Jun 2003 22:42:41 +0200 [thread overview]
Message-ID: <20030606204241.GA28264@lst.de> (raw)
In-Reply-To: <3EE0F86B.4060908@rogers.com>
On Fri, Jun 06, 2003 at 04:24:11PM -0400, Luben Tuikov wrote:
> Christoph Hellwig wrote:
> >Rediffed version, with Mike's isp fix and taking the new
> >scsi_add_host users in usb in account.
> >
> >Currently this is juist a new name for scsi_register, but we make
> >sure new-style drivers never call scsi_register/scsi_unregister
> >but always scsi_host_alloc/scsi_host_put in this patch so the
>
> Why don't you call this scsi_host_free() to complement scsi_host_alloc()?
> Why do you need to reveal implementation by naming it scsi_host_put()?
> As far as the caller of scsi_host_put() is concerned they MUST NOT
> dereference the host thereafter, so you can safely call it scsi_host_free().
> (_When_ it is actually it is freed is what is being hidded as
> implementation.)
scsi_host_get/scsi_host_put are the refcounting primites for
struct Scsi_Host and there are more users then just the host drivers.
(and there will be more soon). It's an idiom in linux to use get/put
for those and make put free it when the refcount reaches zero.
next prev parent reply other threads:[~2003-06-06 20:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-06 8:01 [PATCH] introduce scsi_host_alloc Christoph Hellwig
2003-06-06 11:40 ` Jamie Lenehan
2003-06-06 11:43 ` Christoph Hellwig
2003-06-06 20:24 ` Luben Tuikov
2003-06-06 20:30 ` Luben Tuikov
2003-06-06 20:42 ` Christoph Hellwig [this message]
2003-06-06 23:20 ` Luben Tuikov
2003-06-07 6:44 ` Christoph Hellwig
2003-06-07 18:55 ` Luben Tuikov
-- strict thread matches above, loose matches on Subject: below --
2003-06-03 20:32 Christoph Hellwig
2003-06-05 20:50 ` Mike Anderson
2003-06-05 21:24 ` Christoph Hellwig
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=20030606204241.GA28264@lst.de \
--to=hch@lst.de \
--cc=James.Bottomley@steeleye.com \
--cc=linux-scsi@vger.kernel.org \
--cc=tluben@rogers.com \
/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.