From: Mike Christie <michaelc@cs.wisc.edu>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [RFC PATCH 02/10] scsi bsg: add scsi bsg helper lib
Date: Fri, 22 Jul 2011 22:19:42 -0500 [thread overview]
Message-ID: <4E2A3DCE.6090605@cs.wisc.edu> (raw)
In-Reply-To: <20110723011924Q.fujita.tomonori@lab.ntt.co.jp>
On 07/22/2011 11:31 AM, FUJITA Tomonori wrote:
>> +/**
>> + * scsi_destroy_bsg_job - routine to teardown/delete a bsg job
>> + * @job: scsi_bsg_job that is to be torn down
>> + */
>> +static void scsi_destroy_bsg_job(struct scsi_bsg_job *job)
>> +{
>> + unsigned long flags;
>> +
>> + spin_lock_irqsave(&job->job_lock, flags);
>> + if (job->ref_cnt) {
>> + spin_unlock_irqrestore(&job->job_lock, flags);
>> + return;
>> + }
>> + spin_unlock_irqrestore(&job->job_lock, flags);
>
> Is this actually a reference counter? Doesn't look like how we use a
> reference counter? If scsi_bsg_job needs it, it would be better to
> just put kref in it?
Yeah, I do not think it is needed. That and the state_flags should not
be needed (state flag seems to duplicate the request state handling). I
have patches to remove that code. I was going to send them separately
though, so just in case I/we are wrong it can be git reverted. I guess
it can just be merged in this patch though.
>> +void scsi_bsg_remove(struct request_queue *q)
>> +{
>> + struct request *req; /* block request */
>> + int counts; /* totals for request_list count and starved */
>
> This function looks hacky a bit (e.g. peeking at the queue internal
> values such as count and starved). Can we do this in a different way
> (less hacky way)?
>
>> + }
>> +
>> + msleep(200); /* allow bsg to possibly finish */
>
> Hmm, what's it? Do we need to fix something about bsg?
James Smart had added this in 78d16341facf829a71b6f7c68ec5511b9c168060.
I do not think it can be easily fixed. I think he is working on a better
long term fix.
next prev parent reply other threads:[~2011-07-23 3:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-22 10:04 [RFC PATCH 00/10] create scsi bsg lib michaelc
2011-07-22 10:04 ` [RFC PATCH 01/10] scsi transport: add bsg callouts michaelc
2011-07-22 10:04 ` [RFC PATCH 02/10] scsi bsg: add scsi bsg helper lib michaelc
2011-07-22 16:31 ` FUJITA Tomonori
2011-07-23 3:19 ` Mike Christie [this message]
2011-07-22 10:04 ` [RFC PATCH 03/10] FC class: convert to scsi bsg lib michaelc
2011-07-22 10:04 ` [RFC PATCH 04/10] iscsi class: add bsg support to iscsi class michaelc
2011-07-22 10:04 ` [RFC PATCH 05/10] ibmvfc: convert ibmvfc to scsi bsg lib michaelc
2011-07-22 10:04 ` [RFC PATCH 06/10] libfc: convert " michaelc
2011-07-22 10:04 ` [RFC PATCH 07/10] zfcp: convert zfcp to scsi bsg lib V2 michaelc
2011-07-22 10:04 ` [RFC PATCH 08/10] qla2xxx: convert qla2xxx to scsi bsg lib michaelc
2011-07-22 10:04 ` [RFC PATCH 09/10] lpfc: convert lpfc " michaelc
2011-07-22 10:05 ` [RFC PATCH 10/10] bfa: convert bfa " michaelc
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=4E2A3DCE.6090605@cs.wisc.edu \
--to=michaelc@cs.wisc.edu \
--cc=fujita.tomonori@lab.ntt.co.jp \
--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