aboutsummaryrefslogtreecommitdiffstats
path: root/fs/compat_ioctl.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2007-10-09 07:23:51 -0400
committerJens Axboe <axboe@carl.home.kernel.dk>2007-10-10 03:26:00 -0400
commitf58c4c0a17e500e767473598b3deafaa1d64051d (patch)
treef8fbf3a2ce10a9fccf41f2f96bca1ca71b3dd77e /fs/compat_ioctl.c
parentd2bbf3da3759d04cd5836955cc59c8ae96092831 (diff)
compat_ioctl: move common block ioctls to compat_blkdev_ioctl
Make compat_blkdev_ioctl and blkdev_ioctl reflect the respective native versions. This is somewhat more efficient and makes it easier to keep the two in sync. Also get rid of the bogus handling for broken_blkgetsize and the duplicate entry for BLKRASET. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/compat_ioctl.c')
-rw-r--r--fs/compat_ioctl.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 37310b0e8107..6be121868c60 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -1537,12 +1537,6 @@ ret_einval(unsigned int fd, unsigned int cmd, unsigned long arg)
1537} 1537}
1538 1538
1539#ifdef CONFIG_BLOCK 1539#ifdef CONFIG_BLOCK
1540static int broken_blkgetsize(unsigned int fd, unsigned int cmd, unsigned long arg)
1541{
1542 /* The mkswap binary hard codes it to Intel value :-((( */
1543 return w_long(fd, BLKGETSIZE, arg);
1544}
1545
1546struct blkpg_ioctl_arg32 { 1540struct blkpg_ioctl_arg32 {
1547 compat_int_t op; 1541 compat_int_t op;
1548 compat_int_t flags; 1542 compat_int_t flags;
@@ -1578,29 +1572,6 @@ static int ioc_settimeout(unsigned int fd, unsigned int cmd, unsigned long arg)
1578 return rw_long(fd, AUTOFS_IOC_SETTIMEOUT, arg); 1572 return rw_long(fd, AUTOFS_IOC_SETTIMEOUT, arg);
1579} 1573}
1580 1574
1581#ifdef CONFIG_BLOCK
1582/* Fix sizeof(sizeof()) breakage */
1583#define BLKBSZGET_32 _IOR(0x12,112,int)
1584#define BLKBSZSET_32 _IOW(0x12,113,int)
1585#define BLKGETSIZE64_32 _IOR(0x12,114,int)
1586
1587static int do_blkbszget(unsigned int fd, unsigned int cmd, unsigned long arg)
1588{
1589 return sys_ioctl(fd, BLKBSZGET, (unsigned long)compat_ptr(arg));
1590}
1591
1592static int do_blkbszset(unsigned int fd, unsigned int cmd, unsigned long arg)
1593{
1594 return sys_ioctl(fd, BLKBSZSET, (unsigned long)compat_ptr(arg));
1595}
1596
1597static int do_blkgetsize64(unsigned int fd, unsigned int cmd,
1598 unsigned long arg)
1599{
1600 return sys_ioctl(fd, BLKGETSIZE64, (unsigned long)compat_ptr(arg));
1601}
1602#endif
1603
1604/* Bluetooth ioctls */ 1575/* Bluetooth ioctls */
1605#define HCIUARTSETPROTO _IOW('U', 200, int) 1576#define HCIUARTSETPROTO _IOW('U', 200, int)
1606#define HCIUARTGETPROTO _IOR('U', 201, int) 1577#define HCIUARTGETPROTO _IOR('U', 201, int)
@@ -2546,19 +2517,11 @@ COMPATIBLE_IOCTL(FDFMTTRK)
2546COMPATIBLE_IOCTL(FDRAWCMD) 2517COMPATIBLE_IOCTL(FDRAWCMD)
2547/* 0x12 */ 2518/* 0x12 */
2548#ifdef CONFIG_BLOCK 2519#ifdef CONFIG_BLOCK
2549COMPATIBLE_IOCTL(BLKRASET)
2550COMPATIBLE_IOCTL(BLKROSET)
2551COMPATIBLE_IOCTL(BLKROGET)
2552COMPATIBLE_IOCTL(BLKRRPART)
2553COMPATIBLE_IOCTL(BLKFLSBUF)
2554COMPATIBLE_IOCTL(BLKSECTSET) 2520COMPATIBLE_IOCTL(BLKSECTSET)
2555COMPATIBLE_IOCTL(BLKSSZGET)
2556COMPATIBLE_IOCTL(BLKTRACESTART) 2521COMPATIBLE_IOCTL(BLKTRACESTART)
2557COMPATIBLE_IOCTL(BLKTRACESTOP) 2522COMPATIBLE_IOCTL(BLKTRACESTOP)
2558COMPATIBLE_IOCTL(BLKTRACESETUP) 2523COMPATIBLE_IOCTL(BLKTRACESETUP)
2559COMPATIBLE_IOCTL(BLKTRACETEARDOWN) 2524COMPATIBLE_IOCTL(BLKTRACETEARDOWN)
2560ULONG_IOCTL(BLKRASET)
2561ULONG_IOCTL(BLKFRASET)
2562#endif 2525#endif
2563/* RAID */ 2526/* RAID */
2564COMPATIBLE_IOCTL(RAID_VERSION) 2527COMPATIBLE_IOCTL(RAID_VERSION)
@@ -3337,11 +3300,6 @@ HANDLE_IOCTL(SIOCGSTAMPNS, do_siocgstampns)
3337#endif 3300#endif
3338#ifdef CONFIG_BLOCK 3301#ifdef CONFIG_BLOCK
3339HANDLE_IOCTL(HDIO_GETGEO, hdio_getgeo) 3302HANDLE_IOCTL(HDIO_GETGEO, hdio_getgeo)
3340HANDLE_IOCTL(BLKRAGET, w_long)
3341HANDLE_IOCTL(BLKGETSIZE, w_long)
3342HANDLE_IOCTL(0x1260, broken_blkgetsize)
3343HANDLE_IOCTL(BLKFRAGET, w_long)
3344HANDLE_IOCTL(BLKSECTGET, w_long)
3345HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans) 3303HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans)
3346HANDLE_IOCTL(HDIO_GET_UNMASKINTR, hdio_ioctl_trans) 3304HANDLE_IOCTL(HDIO_GET_UNMASKINTR, hdio_ioctl_trans)
3347HANDLE_IOCTL(HDIO_GET_MULTCOUNT, hdio_ioctl_trans) 3305HANDLE_IOCTL(HDIO_GET_MULTCOUNT, hdio_ioctl_trans)
@@ -3415,9 +3373,6 @@ HANDLE_IOCTL(SONET_GETFRAMING, do_atm_ioctl)
3415HANDLE_IOCTL(SONET_GETFRSENSE, do_atm_ioctl) 3373HANDLE_IOCTL(SONET_GETFRSENSE, do_atm_ioctl)
3416/* block stuff */ 3374/* block stuff */
3417#ifdef CONFIG_BLOCK 3375#ifdef CONFIG_BLOCK
3418HANDLE_IOCTL(BLKBSZGET_32, do_blkbszget)
3419HANDLE_IOCTL(BLKBSZSET_32, do_blkbszset)
3420HANDLE_IOCTL(BLKGETSIZE64_32, do_blkgetsize64)
3421/* Raw devices */ 3376/* Raw devices */
3422HANDLE_IOCTL(RAW_SETBIND, raw_ioctl) 3377HANDLE_IOCTL(RAW_SETBIND, raw_ioctl)
3423HANDLE_IOCTL(RAW_GETBIND, raw_ioctl) 3378HANDLE_IOCTL(RAW_GETBIND, raw_ioctl)