aboutsummaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
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 /fs/block_dev.c
parent6af3a56e1dd4d95836a47214e5c60d5b749a5501 (diff)
[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 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index b89c956e04f6..05865b93f7e1 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1202,7 +1202,11 @@ static int blkdev_close(struct inode * inode, struct file * filp)
1202 1202
1203static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg) 1203static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg)
1204{ 1204{
1205 return blkdev_ioctl(file->f_mapping->host, file, cmd, arg); 1205 struct block_device *bdev = I_BDEV(file->f_mapping->host);
1206 fmode_t mode = file->f_mode;
1207 if (file->f_flags & O_NDELAY)
1208 mode |= FMODE_NDELAY_NOW;
1209 return blkdev_ioctl(bdev, mode, cmd, arg);
1206} 1210}
1207 1211
1208static const struct address_space_operations def_blk_aops = { 1212static const struct address_space_operations def_blk_aops = {
@@ -1238,7 +1242,7 @@ int ioctl_by_bdev(struct block_device *bdev, unsigned cmd, unsigned long arg)
1238 int res; 1242 int res;
1239 mm_segment_t old_fs = get_fs(); 1243 mm_segment_t old_fs = get_fs();
1240 set_fs(KERNEL_DS); 1244 set_fs(KERNEL_DS);
1241 res = blkdev_ioctl(bdev->bd_inode, NULL, cmd, arg); 1245 res = blkdev_ioctl(bdev, 0, cmd, arg);
1242 set_fs(old_fs); 1246 set_fs(old_fs);
1243 return res; 1247 return res;
1244} 1248}