summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorAl Viro <al@aretha.pdmi.ras.ru>2008-09-19 03:17:36 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-10-21 07:49:14 -0400
commit56b26add02b4bdea81d5e0ebda60db1fe3311ad4 (patch)
tree3e9b5877f77ce24a6d17574ff3d32ae8351fa0ef /block
parent6af3a56e1dd4d95836a47214e5c60d5b749a5501 (diff)
downloadlinux-56b26add02b4bdea81d5e0ebda60db1fe3311ad4.tar.gz
linux-56b26add02b4bdea81d5e0ebda60db1fe3311ad4.tar.bz2
linux-56b26add02b4bdea81d5e0ebda60db1fe3311ad4.zip
[PATCH] kill the rest of struct file propagation in block ioctls
Now we can switch blkdev_ioctl() block_device/mode Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'block')
-rw-r--r--block/compat_ioctl.c10
-rw-r--r--block/ioctl.c9
2 files changed, 6 insertions, 13 deletions
diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
index 5b3db0640d87..3098c92402fd 100644
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
@@ -177,7 +177,7 @@ struct compat_blkpg_ioctl_arg {
compat_caddr_t data;
};
-static int compat_blkpg_ioctl(struct inode *inode, struct file *file,
+static int compat_blkpg_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, struct compat_blkpg_ioctl_arg __user *ua32)
{
struct blkpg_ioctl_arg __user *a = compat_alloc_user_space(sizeof(*a));
@@ -196,7 +196,7 @@ static int compat_blkpg_ioctl(struct inode *inode, struct file *file,
if (err)
return err;
- return blkdev_ioctl(inode, file, cmd, (unsigned long)a);
+ return blkdev_ioctl(bdev, mode, cmd, (unsigned long)a);
}
#define BLKBSZGET_32 _IOR(0x12, 112, int)
@@ -715,13 +715,13 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
* but we call blkdev_ioctl, which gets the lock for us
*/
case BLKRRPART:
- return blkdev_ioctl(inode, file, cmd,
+ return blkdev_ioctl(bdev, mode, cmd,
(unsigned long)compat_ptr(arg));
case BLKBSZSET_32:
- return blkdev_ioctl(inode, file, BLKBSZSET,
+ return blkdev_ioctl(bdev, mode, BLKBSZSET,
(unsigned long)compat_ptr(arg));
case BLKPG:
- return compat_blkpg_ioctl(inode, file, cmd, compat_ptr(arg));
+ return compat_blkpg_ioctl(bdev, mode, cmd, compat_ptr(arg));
case BLKRAGET:
case BLKFRAGET:
if (!arg)
diff --git a/block/ioctl.c b/block/ioctl.c
index 14b7f2c10662..c832d639b6e2 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -230,20 +230,13 @@ EXPORT_SYMBOL_GPL(__blkdev_driver_ioctl);
* always keep this in sync with compat_blkdev_ioctl() and
* compat_blkdev_locked_ioctl()
*/
-int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
+int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
unsigned long arg)
{
- struct block_device *bdev = inode->i_bdev;
struct gendisk *disk = bdev->bd_disk;
struct backing_dev_info *bdi;
loff_t size;
int ret, n;
- fmode_t mode = 0;
- if (file) {
- mode = file->f_mode;
- if (file->f_flags & O_NDELAY)
- mode |= FMODE_NDELAY_NOW;
- }
switch(cmd) {
case BLKFLSBUF: