]> bbs.cooldavid.org Git - net-next-2.6.git/commit - fs/block_dev.c
block: push down BKL into .open and .release
authorArnd Bergmann <arnd@arndb.de>
Sat, 7 Aug 2010 16:25:34 +0000 (18:25 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Sat, 7 Aug 2010 16:25:34 +0000 (18:25 +0200)
commit6e9624b8caec290d28b4c6d9ec75749df6372b87
tree47225b544e1da82742795553dc4e8aa70c17afdc
parent8a6cfeb6deca3a8fefd639d898b0d163c0b5d368
block: push down BKL into .open and .release

The open and release block_device_operations are currently
called with the BKL held. In order to change that, we must
first make sure that all drivers that currently rely
on this have no regressions.

This blindly pushes the BKL into all .open and .release
operations for all block drivers to prepare for the
next step. The drivers can subsequently replace the BKL
with their own locks or remove it completely when it can
be shown that it is not needed.

The functions blkdev_get and blkdev_put are the only
remaining users of the big kernel lock in the block
layer, besides a few uses in the ioctl code, none
of which need to serialize with blkdev_{get,put}.

Most of these two functions is also under the protection
of bdev->bd_mutex, including the actual calls to
->open and ->release, and the common code does not
access any global data structures that need the BKL.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
39 files changed:
arch/um/drivers/ubd_kern.c
drivers/block/DAC960.c
drivers/block/amiflop.c
drivers/block/aoe/aoeblk.c
drivers/block/ataflop.c
drivers/block/cciss.c
drivers/block/cpqarray.c
drivers/block/drbd/drbd_main.c
drivers/block/floppy.c
drivers/block/loop.c
drivers/block/paride/pcd.c
drivers/block/paride/pd.c
drivers/block/paride/pf.c
drivers/block/pktcdvd.c
drivers/block/swim.c
drivers/block/swim3.c
drivers/block/ub.c
drivers/block/viodasd.c
drivers/block/xen-blkfront.c
drivers/block/xsysace.c
drivers/block/z2ram.c
drivers/cdrom/gdrom.c
drivers/cdrom/viocd.c
drivers/ide/ide-cd.c
drivers/ide/ide-gd.c
drivers/ide/ide-tape.c
drivers/md/dm.c
drivers/md/md.c
drivers/memstick/core/mspro_block.c
drivers/message/i2o/i2o_block.c
drivers/mmc/card/block.c
drivers/mtd/mtd_blkdevs.c
drivers/s390/block/dasd.c
drivers/s390/block/dcssblk.c
drivers/s390/char/tape_block.c
drivers/scsi/sd.c
drivers/scsi/sr.c
drivers/staging/hv/blkvsc_drv.c
fs/block_dev.c