RE: [PATCH 2/4] mvsas: Deadlocks meet when TMF tasks issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2009-05-09 at 00:25 -0700, Andy Yan wrote:
> 	For considering the possibility of future use, I did not remove the parameter; I will check this and remove it with next patch if it is OK.

Well, there are two reasons for removing it.  The first is that it's
unused, but the second is that conditional locking isn't very nice
programming style, since it makes control flow far harder to follow
rationally when just reading the code.  The preferred style is to define
a function that does the unlocked operation, usually with double
underscores and then have a locked version that takes the lock, calls
the double underscore unlocked version and releases the lock again.  In
your case, if you find a use for the unlocked version, you can split it
in the patch that's using it.

Looking at the routine, the only thing you call outside the lock is
mvs_find_dev_mvi().  The thing that strikes me here is that this is a
bit inefficient: why not store mvi in struct mvs_device?  Then you can
get it as a simple pointer operation instead of having to search.

James


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux