On Thu, 2010-09-02 at 12:48 -0700, Nicholas A. Bellinger wrote:
> > Yeah but direct use makes things more obvious at first look. However
> > neatness is worthy using wrapper(macros) if there are several such
> > places. Anycase this is very minor code style thing here and I'm
> fine
> > with wrapper if you want.
>
> Sure, I am thinking about these simple host_lock wrappers as more of a
> transitional look for LLDs more than anything..
>
> Btw, I would be happy to include your forthcoming v2 patch into a
> lio-core-2.6.git branch, and give it some testing in the next week.
>
Awesome, Thanks for your all help Nab,
I tried to have wrapper instead of checks to drop host_lock before
fc_queuecommand using wrapper something like this :-
+static inline void scsi_qcmd_host_unlock(struct Scsi_Host *shost,
unsigned long irq_flags)
+{
+ if (shost->host_lock_pending) {
+ shost->host_lock_pending = 0;
+ spin_unlock_irqrestore(shost->host_lock, irq_flags);
+ } else if (shost->unlocked_qcmds)
+ spin_unlock_irqrestore(shost->host_lock, irq_flags);
+ else
+ shost->host_lock_pending = 1;
+}
+
This didn't work well beside required lot more checks to track host lock
so that this wrapper can be called w/o checks as:-
scsi_qcmd_host_unlock(host, flags);
rtn = host->hostt->queuecommand(cmd, scsi_done);
scsi_qcmd_host_unlock(host, flags);
I think it is better of with simple checks for now as I posted in my
patch, may be a wrapper can be added in case more places neeeds such
checks as we talked before.
Thanks
Vasu
_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel