nvme-multipath: support io stats on the mpath device
[linux-2.6-microblaze.git] / block / ioctl.c
index 60121e8..9661751 100644 (file)
@@ -467,9 +467,10 @@ static int blkdev_bszset(struct block_device *bdev, fmode_t mode,
  * user space. Note the separate arg/argp parameters that are needed
  * to deal with the compat_ptr() conversion.
  */
-static int blkdev_common_ioctl(struct block_device *bdev, fmode_t mode,
-                               unsigned cmd, unsigned long arg, void __user *argp)
+static int blkdev_common_ioctl(struct file *file, fmode_t mode, unsigned cmd,
+                              unsigned long arg, void __user *argp)
 {
+       struct block_device *bdev = I_BDEV(file->f_mapping->host);
        unsigned int max_sectors;
 
        switch (cmd) {
@@ -527,7 +528,8 @@ static int blkdev_common_ioctl(struct block_device *bdev, fmode_t mode,
                        return -EACCES;
                if (bdev_is_partition(bdev))
                        return -EINVAL;
-               return disk_scan_partitions(bdev->bd_disk, mode & ~FMODE_EXCL);
+               return disk_scan_partitions(bdev->bd_disk, mode & ~FMODE_EXCL,
+                                           file);
        case BLKTRACESTART:
        case BLKTRACESTOP:
        case BLKTRACETEARDOWN:
@@ -605,7 +607,7 @@ long blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
                break;
        }
 
-       ret = blkdev_common_ioctl(bdev, mode, cmd, arg, argp);
+       ret = blkdev_common_ioctl(file, mode, cmd, arg, argp);
        if (ret != -ENOIOCTLCMD)
                return ret;
 
@@ -674,7 +676,7 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
                break;
        }
 
-       ret = blkdev_common_ioctl(bdev, mode, cmd, arg, argp);
+       ret = blkdev_common_ioctl(file, mode, cmd, arg, argp);
        if (ret == -ENOIOCTLCMD && disk->fops->compat_ioctl)
                ret = disk->fops->compat_ioctl(bdev, mode, cmd, arg);