diff options
| author | Alexander Viro <viro@math.psu.edu> | 2002-07-20 20:48:25 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-07-20 20:48:25 -0700 |
| commit | 9d16ed715038fbe847f896320d5f50ceab7bfc53 (patch) | |
| tree | 49568da3ffb1dc1d87e44e2a86b8b2473f2a347b /fs/block_dev.c | |
| parent | 81d4c00c63a03a1a2fa54c6a2fde84454550338c (diff) | |
[PATCH] blk_ioctl() not exported anymore
blk_ioctl() not exported anymore; calls moved from drivers to block_dev.c.
Diffstat (limited to 'fs/block_dev.c')
| -rw-r--r-- | fs/block_dev.c | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 8166aea9be6a..2a0304c00c77 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -514,19 +514,6 @@ int check_disk_change(kdev_t dev) return 1; } -int ioctl_by_bdev(struct block_device *bdev, unsigned cmd, unsigned long arg) -{ - int res; - mm_segment_t old_fs = get_fs(); - - if (!bdev->bd_op->ioctl) - return -EINVAL; - set_fs(KERNEL_DS); - res = bdev->bd_op->ioctl(bdev->bd_inode, NULL, cmd, arg); - set_fs(old_fs); - return res; -} - static int do_open(struct block_device *bdev, struct inode *inode, struct file *file) { int ret = -ENXIO; @@ -731,15 +718,37 @@ static int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd, { int ret = -EINVAL; switch (cmd) { + /* + * deprecated, use the /proc/iosched interface instead + */ + case BLKELVGET: + case BLKELVSET: + ret = -ENOTTY; + break; case BLKRAGET: + case BLKROGET: + case BLKBSZGET: + case BLKSSZGET: case BLKFRAGET: + case BLKSECTGET: case BLKRASET: case BLKFRASET: + case BLKBSZSET: + case BLKPG: ret = blk_ioctl(inode->i_bdev, cmd, arg); break; default: if (inode->i_bdev->bd_op->ioctl) ret =inode->i_bdev->bd_op->ioctl(inode, file, cmd, arg); + if (ret == -EINVAL) { + switch (cmd) { + case BLKGETSIZE: + case BLKGETSIZE64: + case BLKFLSBUF: + case BLKROSET: + ret = blk_ioctl(inode->i_bdev,cmd,arg); + } + } break; } return ret; @@ -767,6 +776,16 @@ struct file_operations def_blk_fops = { ioctl: blkdev_ioctl, }; +int ioctl_by_bdev(struct block_device *bdev, unsigned cmd, unsigned long arg) +{ + int res; + mm_segment_t old_fs = get_fs(); + set_fs(KERNEL_DS); + res = blkdev_ioctl(bdev->bd_inode, NULL, cmd, arg); + set_fs(old_fs); + return res; +} + const char *__bdevname(kdev_t dev) { static char buffer[32]; |
