linux/drivers
Arnd Bergmann 76a64921da isdn: 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: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 20:21:47 -07:00
..
accessibility
acpi Merge branch 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6 2010-05-28 16:14:17 -07:00
amba
ata libata: implement dump_id force param 2010-05-25 19:41:19 -04:00
atm atm/suni.c: call atm_dev_signal_change() when signal changes. 2010-07-09 00:09:23 -07:00
auxdisplay auxdisplay: section cleanup in cfag12864bfb driver 2010-05-25 08:07:09 -07:00
base device.h drivers/base/core.c Convert dev_<level> logging macros to functions 2010-07-04 10:40:17 -07:00
block Merge remote branch 'origin' into secretlab/next-devicetree 2010-05-22 00:36:56 -06:00
bluetooth drivers: bluetooth: bluecard_cs.c: Fixed include error, changed to linux/io.h 2010-07-01 21:28:14 -07:00
cdrom
char drop unused dentry argument to ->fsync 2010-05-27 22:05:02 -04:00
clocksource Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-05-19 17:10:57 -07:00
connector
cpufreq
cpuidle Merge branch 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6 2010-05-28 16:14:17 -07:00
crypto Merge remote branch 'origin' into secretlab/next-devicetree 2010-05-22 00:36:56 -06:00
dca
dio
dma Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx 2010-05-30 09:12:43 -07:00
edac drivers/edac: convert logging messages direct uses of __FILE__ to %s, __FILE 2010-05-27 09:12:52 -07:00
eisa
firewire Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2010-05-27 10:22:06 -07:00
firmware sysfs: add struct file* to bin_attr callbacks 2010-05-21 09:37:31 -07:00
gpio gpio: Fix inverted rdc321x gpio data out registers 2010-05-28 01:37:59 +02:00
gpu Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2010-05-28 16:14:40 -07:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2010-05-27 09:19:55 -07:00
hwmon hwmon: (lm75) Add support for the Texas Instruments TMP105 2010-05-27 19:59:03 +02:00
i2c Merge remote branch 'origin' into secretlab/next-devicetree 2010-05-22 00:36:56 -06:00
ide m68k: amiga - Amiga Gayle IDE platform device conversion 2010-05-26 19:51:09 +02:00
idle intel_idle: native hardware cpuidle driver for latest Intel processors 2010-05-28 14:26:20 -04:00
ieee1394 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2010-05-27 10:22:06 -07:00
ieee802154
infiniband IB/{nes, ipoib}: Pass supported flags to ethtool_op_set_flags() 2010-07-04 11:48:14 -07:00
input input: Touchscreen driver for TPS6507x 2010-05-28 01:37:38 +02:00
isdn isdn: autoconvert trivial BKL users to private mutex 2010-07-12 20:21:47 -07:00
leds leds: Fix leds-gpio openfirmware compile issue 2010-05-28 08:35:27 +01:00
lguest
macintosh Merge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing 2010-05-24 08:01:10 -07:00
mca
md md: convert cpu notifier to return encapsulate errno value 2010-05-27 09:12:48 -07:00
media Merge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing 2010-05-24 08:01:10 -07:00
memstick
message drivers/message/i2o/i2o_config.c: use memdup_user 2010-05-27 09:12:41 -07:00
mfd mfd: Rename twl5031 sih modules 2010-05-28 01:38:02 +02:00
misc lktdm: add support for hardlockup, softlockup and hung task crashes 2010-05-27 09:12:54 -07:00
mmc drivers/mmc/host: use ERR_CAST 2010-05-27 09:12:40 -07:00
mtd drop unused dentry argument to ->fsync 2010-05-27 22:05:02 -04:00
net xtsonic: free irq if sonic_open() fails 2010-07-12 20:21:45 -07:00
nubus
of Merge remote branch 'origin' into secretlab/next-devicetree 2010-05-22 00:36:56 -06:00
oprofile
parisc net: fix 64 bit counters on 32 bit arches 2010-07-07 14:58:56 -07:00
parport m68k: amiga - Parallel port platform device conversion 2010-05-26 19:51:09 +02:00
pci Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2010-05-28 14:42:18 -07:00
pcmcia Merge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing 2010-05-24 08:01:10 -07:00
platform Move N014, N051 and CR620 dmi information to load scm dmi table 2010-05-20 10:16:13 -04:00
pnp
power Merge git://git.infradead.org/battery-2.6 2010-05-25 08:16:34 -07:00
pps
ps3
rapidio rapidio: fix new kernel-doc warnings 2010-05-30 09:02:47 -07:00
regulator mfd: AB3100 register access change to abx500 API 2010-05-28 01:37:45 +02:00
rtc mfd: AB3100 register access change to abx500 API 2010-05-28 01:37:45 +02:00
s390 qeth: handle missing z/VM authorization of OSX 2010-06-23 13:16:37 -07:00
sbus Merge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing 2010-05-24 08:01:10 -07:00
scsi net: fix 64 bit counters on 32 bit arches 2010-07-07 14:58:56 -07:00
serial pcnet_cs: add new id (TOSHIBA Modem/LAN Card) 2010-06-16 18:10:54 -07:00
sfi SFI: add sysfs interface for SFI tables. 2010-05-27 12:46:20 -04:00
sh
sn
spi spi/xilinx: Fix compile error 2010-05-25 00:48:24 -06:00
ssb ssb: remove the ssb DMA API 2010-06-04 16:00:42 -04:00
staging net: fix 64 bit counters on 32 bit arches 2010-07-07 14:58:56 -07:00
tc
telephony drivers/telephony/ixj.c: use memdup_user 2010-05-27 09:12:42 -07:00
thermal
uio
usb usb/atm/ueagle-atm.c: call atm_dev_signal_change() when signal changes. 2010-07-09 00:09:24 -07:00
uwb
vhost Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-07-07 15:59:38 -07:00
video drop unused dentry argument to ->fsync 2010-05-27 22:05:02 -04:00
virtio Merge branch 'virtio' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus 2010-05-21 17:22:52 -07:00
vlynq
w1 sysfs: add struct file* to bin_attr callbacks 2010-05-21 09:37:31 -07:00
watchdog mfd: Change rdc321x resources flags to IORESOURCE_IO 2010-05-28 01:37:52 +02:00
xen xen: fix build when SYSRQ is disabled 2010-05-25 08:07:07 -07:00
zorro sysfs: add struct file* to bin_attr callbacks 2010-05-21 09:37:31 -07:00
Kconfig
Makefile intel_idle: native hardware cpuidle driver for latest Intel processors 2010-05-28 14:26:20 -04:00