return -ENOTTY; 
 lock_kernel(); ret = blkdev_locked_ioctl(file, bdev, cmd, arg); unlock_kernel(); if (ret != -ENOIOCTLCMD) return ret;  return blkdev_driver_ioctl(inode, file, disk, cmd, arg); 
int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,			unsigned long arg){	struct block_device *bdev = inode->i_bdev;	struct gendisk *disk = bdev->bd_disk;	struct backing_dev_info *bdi;	int ret, n;	switch (cmd) {	case BLKRAGET:	case BLKFRAGET:		if (!arg)			return -EINVAL;		bdi = blk_get_backing_dev_info(bdev);		if (bdi == NULL)			return -ENOTTY;		return put_long(arg, (bdi->ra_pages * PAGE_CACHE_SIZE) / 512);	case BLKROGET:		return put_int(arg, bdev_read_only(bdev) != 0);	case BLKBSZGET: /* get the logical block size (cf. BLKSSZGET) */		return put_int(arg, block_size(bdev));	case BLKSSZGET: /* get block device hardware sector size */		return put_int(arg, bdev_hardsect_size(bdev));	case BLKSECTGET:		return put_ushort(arg, bdev_get_queue(bdev)->max_sectors);	case BLKRASET:	case BLKFRASET:		if(!capable(CAP_SYS_ADMIN))			return -EACCES;		bdi = blk_get_backing_dev_info(bdev);		if (bdi == NULL)			return -ENOTTY;		bdi->ra_pages = (arg * 512) / PAGE_CACHE_SIZE;		return 0;	case BLKBSZSET:		/* set the logical block size */		if (!capable(CAP_SYS_ADMIN))			return -EACCES;		if (!arg)			return -EINVAL;		if (get_user(n, (int __user *) arg))			return -EFAULT;		if (bd_claim(bdev, file) < 0)			return -EBUSY;		ret = set_blocksize(bdev, n);		bd_release(bdev);		return ret;	case BLKPG:		return blkpg_ioctl(bdev, (struct blkpg_ioctl_arg __user *) arg);	case BLKRRPART:		return blkdev_reread_part(bdev);	case BLKGETSIZE:		if ((bdev->bd_inode->i_size >> 9) > ~0UL)			return -EFBIG;		return put_ulong(arg, bdev->bd_inode->i_size >> 9);	case BLKGETSIZE64:		return put_u64(arg, bdev->bd_inode->i_size);	case BLKFLSBUF:		if (!capable(CAP_SYS_ADMIN))			return -EACCES;		if (disk->fops->ioctl) {			ret = disk->fops->ioctl(inode, file, cmd, arg);			/* -EINVAL to handle old uncorrected drivers */			if (ret != -EINVAL && ret != -ENOTTY)				return ret;		}		fsync_bdev(bdev);		invalidate_bdev(bdev, 0);		return 0;	case BLKROSET:		if (disk->fops->ioctl) {			ret = disk->fops->ioctl(inode, file, cmd, arg);			/* -EINVAL to handle old uncorrected drivers */			if (ret != -EINVAL && ret != -ENOTTY)				return ret;		}		if (!capable(CAP_SYS_ADMIN))			return -EACCES;		if (get_user(n, (int __user *)(arg)))			return -EFAULT;		set_device_ro(bdev, n);		return 0;	default:		if (disk->fops->ioctl)			return disk->fops->ioctl(inode, file, cmd, arg);	}	return -ENOTTY;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/bb93e3a52f8db7210258a1a2134cced0b78a46e1/ioctl.c/clean/drivers/block/ioctl.c