public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Anderson <andmike@us.ibm.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [RFC] scsi host sysfs support again [0/4]
Date: Wed, 7 May 2003 09:15:46 -0700	[thread overview]
Message-ID: <20030507161546.GA3368@beaverton.ibm.com> (raw)
In-Reply-To: <20030507164427.A28899@infradead.org>

Christoph Hellwig [hch@infradead.org] wrote:
> > > Then we'd have:
> > > 
> > > 	scsi_alloc_host
> > > 		- allocate storage for struct Scsi_Host, some
> > > 		  basic initalization.  refcount set to 1;
> > 
> > I am using sysfs ref counting and increment the ref count on the Scsi_Host
> > through device_register and device_get. The scsi_get/put_host wrapper
> > would call device_get/put.
> 
> right.
> 
> > > 	scsi_get_host
> > > 		- get a reference to an existing struct Scsi_Host
> > > 	scsi_put_host
> > > 		- decrement usecount of an existing struct Scsi_Host,
> > > 		  free it if this was the last reference
> > 
> > The sysfs model splits the registering / unregistering so that is why I
> > am unregistering in scsi_remove_host, but may not call the free until
> > someone calls the final put.
> 
> I completly agree with that.  (did something above read like I was
> disagreeing?  I'm a bit confused on this comment..)

No I did not read that you where disagreeing I was just indicating that
I was not calling any sysfs functions from scsi_register do that the
Scsi_Host's struct device and struct class where not initialized until
scsi_add_host.

After reading you mail the other day I believe a better model would be
to split the device_register using the device_initialize and device_add
functions. This will mean that after the return of scsi_register
(scsi_alloc_host) that refcount will be 1 and the Scsi_Host struct is
ready to be used.

I am writing this down write now so it is a little better explained. I
hope to have it out in just a bit.

-andmike
--
Michael Anderson
andmike@us.ibm.com


  reply	other threads:[~2003-05-07 16:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-05  8:33 [RFC] scsi host sysfs support again [0/4] Mike Anderson
2003-05-05  8:34 ` [RFC] scsi host sysfs support again [1/4] Mike Anderson
2003-05-05  8:35   ` [RFC] scsi host sysfs support again [2/4] Mike Anderson
2003-05-05  8:37     ` [RFC] scsi host sysfs support again [3/4] Mike Anderson
2003-05-05  8:38       ` [RFC] scsi host sysfs support again [4/4] Mike Anderson
2003-05-05  8:38 ` [RFC] scsi host sysfs support again [0/4] Christoph Hellwig
2003-05-05  9:40   ` Douglas Gilbert
2003-05-05 10:00     ` Mike Anderson
2003-05-05  9:48   ` Mike Anderson
2003-05-05 10:17     ` Christoph Hellwig
2003-05-06  1:05       ` Mike Anderson
2003-05-07 15:44         ` Christoph Hellwig
2003-05-07 16:15           ` Mike Anderson [this message]
2003-05-07 16:41             ` Christoph Hellwig
2003-05-05 11:46 ` Douglas Gilbert
2003-05-05 21:45   ` Mike Anderson
2003-05-06  1:12     ` Douglas Gilbert
2003-05-06 16:28 ` James Bottomley
2003-05-06 17:23   ` Mike Anderson
2003-05-07 23:19     ` Willem Riede
2003-05-08  0:09       ` Douglas Gilbert
2003-05-08  1:44       ` Mike Anderson

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=20030507161546.GA3368@beaverton.ibm.com \
    --to=andmike@us.ibm.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