block: remove i_bdev
[linux-2.6-microblaze.git] / block / ioctl.c
index 6b78518..a6d8171 100644 (file)
@@ -35,15 +35,6 @@ static int blkpg_do_ioctl(struct block_device *bdev,
        start = p.start >> SECTOR_SHIFT;
        length = p.length >> SECTOR_SHIFT;
 
-       /* check for fit in a hd_struct */
-       if (sizeof(sector_t) < sizeof(long long)) {
-               long pstart = start, plength = length;
-
-               if (pstart != start || plength != length || pstart < 0 ||
-                   plength < 0 || p.pno > 65535)
-                       return -EINVAL;
-       }
-
        switch (op) {
        case BLKPG_ADD_PARTITION:
                /* check if partition is aligned to blocksize */
@@ -599,8 +590,7 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
 {
        int ret;
        void __user *argp = compat_ptr(arg);
-       struct inode *inode = file->f_mapping->host;
-       struct block_device *bdev = inode->i_bdev;
+       struct block_device *bdev = I_BDEV(file->f_mapping->host);
        struct gendisk *disk = bdev->bd_disk;
        fmode_t mode = file->f_mode;
        loff_t size;