Commit graph android_kernel_sony_sdm845/drivers/ide/ide-disk_ioctl.c
Message SHA1
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>

Arnd Bergmann   commited 2010-10-05 15:01:10 +02:00
2a48fc0ab2
block: push down BKL into .locked_ioctl
As a preparation for the removal of the big kernel
lock in the block layer, this removes the BKL
from the common ioctl handling code, moving it
into every single driver still using it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>

Arnd Bergmann   authored and   Jens Axboe   commited 2010-08-07 18:25:00 +02:00
8a6cfeb6de
[PATCH] switch ide_disk_ops ->ioctl() to sane prototype
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro   commited 2008-10-21 07:47:30 -04:00
badf8082c3
[PATCH] lose the unused file argument in generic_ide_ioctl()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro   commited 2008-10-21 07:47:16 -04:00
1bddd9e645
ide: add generic ATA/ATAPI disk driver
* Add struct ide_disk_ops containing protocol specific methods.

* Add 'struct ide_disk_ops *' to ide_drive_t.

* Convert ide-{disk,floppy} drivers to use struct ide_disk_ops.

* Merge ide-{disk,floppy} drivers into generic ide-gd driver.

While at it:
- ide_disk_init_capacity() -> ide_disk_get_capacity()

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Bartlomiej Zolnierkiewicz   commited 2008-10-17 18:09:14 +02:00
806f80a6fc
ide-disk: use to_ide_drv() and ide_drv_g()
There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Bartlomiej Zolnierkiewicz   commited 2008-10-17 18:09:09 +02:00
d7e7475968
ide-disk: move all ioctl handling to ide-disk_ioctl.c
While at it:
- idedisk_ioctl() -> ide_disk_ioctl()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Bartlomiej Zolnierkiewicz   commited 2008-10-13 21:39:45 +02:00
f87904898e