linux-stable/drivers/message/fusion
Arnd Bergmann c45d15d24e scsi: autoconvert trivial BKL users to private mutex
All these files use the big kernel lock in a trivial
way to serialize their private file operations,
typically resulting from an earlier semi-automatic
pushdown from VFS.

None of these drivers appears to want to lock against
other code, and they all use the BKL as the top-level
lock in their file operations, meaning that there
is no lock-order inversion problem.

Consequently, we can remove the BKL completely,
replacing it with a per-file mutex in every case.
Using a scripted approach means we can avoid
typos.

file=$1
name=$2
if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
            sed -i '/include.*<linux\/smp_lock.h>/d' ${file}
    else
            sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file}
    fi
    sed -i ${file} \
        -e "/^#include.*linux.mutex.h/,$ {
                1,/^\(static\|int\|long\)/ {
                     /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

} }"  \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[      ]*cycle_kernel_lock();/d'
else
    sed -i -e '/include.*\<smp_lock.h\>/d' ${file}  \
                -e '/cycle_kernel_lock()/d'
fi

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: linux-scsi@vger.kernel.org
Cc: "James E.J. Bottomley" <James.Bottomley@suse.de>
2010-09-15 21:00:45 +02:00
..
lsi trivial: Miscellaneous documentation typo fixes 2009-06-12 18:01:47 +02:00
Kconfig
Makefile
mptbase.c fusion: add function parameter names to kernel-doc 2010-08-14 16:21:00 -07:00
mptbase.h mpt fusion: convert to seq_file 2010-08-11 08:59:00 -07:00
mptctl.c scsi: autoconvert trivial BKL users to private mutex 2010-09-15 21:00:45 +02:00
mptctl.h
mptdebug.h [SCSI] mpt fusion: Fixing 1078 data corruption issue for 36GB memory region 2009-06-09 17:21:31 -05:00
mptfc.c [SCSI] mptfusion: Extra debug prints added relavent to Device missing delay error handling 2010-07-28 09:07:47 -05:00
mptlan.c [SCSI] mptfusion: Extra debug prints added relavent to Device missing delay error handling 2010-07-28 09:07:47 -05:00
mptlan.h mptlan: Kill directly reference of netdev->priv 2008-12-03 21:13:37 -08:00
mptsas.c [SCSI] mptfusion: Extra debug prints added relavent to Device missing delay error handling 2010-07-28 09:07:47 -05:00
mptsas.h [SCSI] mptfusion: Added sanity to check B_T mapping for device before adding to OS 2010-07-27 12:02:32 -05:00
mptscsih.c [SCSI] mptfusion: Block Error handling for deleting devices or Device in DMD 2010-07-28 09:07:46 -05:00
mptscsih.h [SCSI] modify change_queue_depth to take in reason why it is being called 2009-12-04 12:00:41 -06:00
mptspi.c [SCSI] mptfusion: Extra debug prints added relavent to Device missing delay error handling 2010-07-28 09:07:47 -05:00