public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
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: Sat, 7 Jun 2003 08:44:56 +0200	[thread overview]
Message-ID: <20030607064456.GA1668@lst.de> (raw)
In-Reply-To: <3EE121A7.8010806@rogers.com>

On Fri, Jun 06, 2003 at 07:20:07PM -0400, Luben Tuikov wrote:
> Christoph Hellwig wrote:
> >
> >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.
> 
> I know about the get/put idiom, refcounting, etc.
> 
> *But* your use is alloc <--> put.  This is what throws me off.

It's not.  It's alloc[, get, put, get, put], put.  alloc is
get a new dynamic allocate structure with refcount one, after
that we can get another reference with get, or a reference from hostno
with lookup and then put it again - when the refcount reches zero
it's freed.


  reply	other threads:[~2003-06-07  6:31 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
2003-06-06 23:20     ` Luben Tuikov
2003-06-07  6:44       ` Christoph Hellwig [this message]
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=20030607064456.GA1668@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox