From: Brian King <brking@us.ibm.com>
To: Kai Makisara <Kai.Makisara@kolumbus.fi>
Cc: "Dailey, Nate" <Nate.Dailey@stratus.com>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] drivers/scsi/st.c: add reference count and related fixes
Date: Thu, 07 Jul 2005 08:24:10 -0500 [thread overview]
Message-ID: <42CD2CFA.20902@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0507071332570.2964@kai.makisara.local>
Kai Makisara wrote:
>>The primary change is adding a kref to the Scsi_Tape structure, to avoid
>>an oops when the tape drive is removed while open. This includes
>>scsi_tape_get/put routines and scsi_tape_release, and changes to st_open
>>and st_release. This is all based on the SCSI disk & CD reference
>>counting code.
>>
>
> You have added a new kref for this. Have you considered using the
> existing cdev refcounting instead of a separate kref?
>
> (When the new character device code was introduced, I got the impression
> that the proper way for the st would be to embed the struct into struct
> scsi_tape and make the destructor. The scsi_tapes[] array would not be
> necessary any more because the struct scsi_tape would be accessible through
> containerof(inode->i_cdev, struct scsi_tape, cdev).
> (An array would be still necessary for tape number allocation.)
> I did not implement this at that time because there was no real need for
> the change and it seemed too complex to test just for fun.)
I'm not sure how you would do this since there is currently no way to
embed data in a cdev. Also, since there are multiple cdevs per scsi_tape,
it seems cleaner to use a new kref.
--
Brian King
eServer Storage I/O
IBM Linux Technology Center
next prev parent reply other threads:[~2005-07-07 13:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-05 17:10 [PATCH] drivers/scsi/st.c: add reference count and related fixes Dailey, Nate
2005-07-06 20:01 ` Brian King
2005-07-07 11:11 ` Kai Makisara
2005-07-07 13:24 ` Brian King [this message]
2005-07-07 17:06 ` Kai Makisara
-- strict thread matches above, loose matches on Subject: below --
2005-07-12 15:10 Dailey, Nate
2005-07-12 20:07 ` Kai Makisara
2005-07-13 19:12 Dailey, Nate
2005-07-25 19:54 ` Brian King
2005-08-02 10:40 ` Kai Makisara
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=42CD2CFA.20902@us.ibm.com \
--to=brking@us.ibm.com \
--cc=Kai.Makisara@kolumbus.fi \
--cc=Nate.Dailey@stratus.com \
--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.