kernel-hacking-2024-linux-s.../drivers/s390/char
Arnd Bergmann 2a48fc0ab2 block: autoconvert trivial BKL users to private mutex
The block device drivers have all gained new lock_kernel
calls from a recent pushdown, and some of the drivers
were already using the BKL before.

This turns the BKL into a set of per-driver mutexes.
Still need to check whether this is safe to do.

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>
2010-10-05 15:01:10 +02:00
..
con3215.c
con3270.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ctrlchar.c Input: sysrq - drop tty argument form handle_sysrq() 2010-08-21 00:34:45 -07:00
ctrlchar.h
defkeymap.c
defkeymap.map
fs3270.c [S390] avoid default_llseek in s390 drivers 2010-05-17 10:00:16 +02:00
Kconfig [S390] vmcp: disallow modular build 2010-05-17 10:00:15 +02:00
keyboard.c Input: sysrq - drop tty argument form handle_sysrq() 2010-08-21 00:34:45 -07:00
keyboard.h
Makefile
monreader.c s390: remove WARN_ON for misc_deregister() failures 2010-08-09 20:45:06 -07:00
monwriter.c s390: remove WARN_ON for misc_deregister() failures 2010-08-09 20:45:06 -07:00
raw3270.c
raw3270.h
sclp.c
sclp.h
sclp_async.c [S390] sclp_async: potential buffer overflow 2010-04-09 13:43:02 +02:00
sclp_cmd.c [S390] sclp: avoid 64 bit division 2010-03-24 11:49:53 +01:00
sclp_con.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sclp_config.c
sclp_cpi.c
sclp_cpi_sys.c Fix typos in comments 2010-03-16 11:47:56 +01:00
sclp_cpi_sys.h
sclp_quiesce.c
sclp_rw.c
sclp_rw.h
sclp_sdias.c
sclp_tty.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sclp_tty.h
sclp_vt220.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
tape.h
tape_34xx.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
tape_3590.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
tape_3590.h
tape_block.c block: autoconvert trivial BKL users to private mutex 2010-10-05 15:01:10 +02:00
tape_char.c
tape_class.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
tape_class.h
tape_core.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
tape_proc.c
tape_std.c
tape_std.h
tty3270.c
tty3270.h
vmcp.c [S390] vmcp: disallow modular build 2010-05-17 10:00:15 +02:00
vmcp.h
vmlogrdr.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
vmur.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
vmur.h
vmwatchdog.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
zcore.c [S390] avoid default_llseek in s390 drivers 2010-05-17 10:00:16 +02:00