Pull bugzilla-7897 into release branch
[sfrench/cifs-2.6.git] / block / ioctl.c
index 58aab630dfc1a55eaf06975d5a48600b5f14e49e..e3f5eb9882cf4dfb403f6ca64f7262180b9db0fa 100644 (file)
@@ -61,7 +61,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
                                }
                        }
                        /* all seems OK */
-                       add_partition(disk, part, start, length);
+                       add_partition(disk, part, start, length, ADDPART_FLAG_NONE);
                        mutex_unlock(&bdev->bd_mutex);
                        return 0;
                case BLKPG_DEL_PARTITION:
@@ -72,7 +72,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
                        bdevp = bdget_disk(disk, part);
                        if (!bdevp)
                                return -ENOMEM;
-                       mutex_lock_nested(&bdevp->bd_mutex, BD_MUTEX_PARTITION);
+                       mutex_lock(&bdevp->bd_mutex);
                        if (bdevp->bd_openers) {
                                mutex_unlock(&bdevp->bd_mutex);
                                bdput(bdevp);
@@ -82,7 +82,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
                        fsync_bdev(bdevp);
                        invalidate_bdev(bdevp, 0);
 
-                       mutex_lock_nested(&bdev->bd_mutex, BD_MUTEX_WHOLE);
+                       mutex_lock(&bdev->bd_mutex);
                        delete_partition(disk, part);
                        mutex_unlock(&bdev->bd_mutex);
                        mutex_unlock(&bdevp->bd_mutex);
@@ -290,7 +290,7 @@ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
    ENOIOCTLCMD for unknown ioctls. */
 long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
 {
-       struct block_device *bdev = file->f_dentry->d_inode->i_bdev;
+       struct block_device *bdev = file->f_path.dentry->d_inode->i_bdev;
        struct gendisk *disk = bdev->bd_disk;
        int ret = -ENOIOCTLCMD;
        if (disk->fops->compat_ioctl) {