aboutsummaryrefslogtreecommitdiffstats
path: root/fs/compat_ioctl.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-07-03 18:15:07 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2010-08-08 18:13:34 -0400
commitc9243f5bdd6637b2bb7dc254b54d9edf957ef17e (patch)
tree254c0733f9d547651f467ed6502c7335804eaaf8 /fs/compat_ioctl.c
parent86a5ef7d777cdd61dfe82379d559dbea069aea3d (diff)
autofs/autofs4: Move compat_ioctl handling into fs
Handling of autofs ioctl numbers does not need to be generic and can easily be done directly in autofs itself. This also pushes the BKL into autofs and autofs4 ioctl methods. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: H. Peter Anvin <hpa@zytor.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Ian Kent <raven@themaw.net> Cc: Autofs <autofs@linux.kernel.org> Cc: John Kacur <jkacur@redhat.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'fs/compat_ioctl.c')
-rw-r--r--fs/compat_ioctl.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 641640dc7ae5..618f38136304 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -131,23 +131,6 @@ static int w_long(unsigned int fd, unsigned int cmd,
131 return err; 131 return err;
132} 132}
133 133
134static int rw_long(unsigned int fd, unsigned int cmd,
135 compat_ulong_t __user *argp)
136{
137 mm_segment_t old_fs = get_fs();
138 int err;
139 unsigned long val;
140
141 if(get_user(val, argp))
142 return -EFAULT;
143 set_fs (KERNEL_DS);
144 err = sys_ioctl(fd, cmd, (unsigned long)&val);
145 set_fs (old_fs);
146 if (!err && put_user(val, argp))
147 return -EFAULT;
148 return err;
149}
150
151struct compat_video_event { 134struct compat_video_event {
152 int32_t type; 135 int32_t type;
153 compat_time_t timestamp; 136 compat_time_t timestamp;
@@ -594,12 +577,6 @@ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd,
594 return err; 577 return err;
595} 578}
596 579
597static int ioc_settimeout(unsigned int fd, unsigned int cmd,
598 compat_ulong_t __user *argp)
599{
600 return rw_long(fd, AUTOFS_IOC_SETTIMEOUT, argp);
601}
602
603/* Bluetooth ioctls */ 580/* Bluetooth ioctls */
604#define HCIUARTSETPROTO _IOW('U', 200, int) 581#define HCIUARTSETPROTO _IOW('U', 200, int)
605#define HCIUARTGETPROTO _IOR('U', 201, int) 582#define HCIUARTGETPROTO _IOR('U', 201, int)
@@ -1281,13 +1258,6 @@ COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE5)
1281COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS) 1258COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS)
1282COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS) 1259COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS)
1283COMPATIBLE_IOCTL(OSS_GETVERSION) 1260COMPATIBLE_IOCTL(OSS_GETVERSION)
1284/* AUTOFS */
1285COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC)
1286COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER)
1287COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE)
1288COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI)
1289COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOSUBVER)
1290COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT)
1291/* Raw devices */ 1261/* Raw devices */
1292COMPATIBLE_IOCTL(RAW_SETBIND) 1262COMPATIBLE_IOCTL(RAW_SETBIND)
1293COMPATIBLE_IOCTL(RAW_GETBIND) 1263COMPATIBLE_IOCTL(RAW_GETBIND)
@@ -1552,9 +1522,6 @@ static long do_ioctl_trans(int fd, unsigned int cmd,
1552 case RAW_GETBIND: 1522 case RAW_GETBIND:
1553 return raw_ioctl(fd, cmd, argp); 1523 return raw_ioctl(fd, cmd, argp);
1554#endif 1524#endif
1555#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,unsigned int)
1556 case AUTOFS_IOC_SETTIMEOUT32:
1557 return ioc_settimeout(fd, cmd, argp);
1558 /* One SMB ioctl needs translations. */ 1525 /* One SMB ioctl needs translations. */
1559#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t) 1526#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t)
1560 case SMB_IOC_GETMOUNTUID_32: 1527 case SMB_IOC_GETMOUNTUID_32:
@@ -1609,9 +1576,6 @@ static long do_ioctl_trans(int fd, unsigned int cmd,
1609 case KDSKBMETA: 1576 case KDSKBMETA:
1610 case KDSKBLED: 1577 case KDSKBLED:
1611 case KDSETLED: 1578 case KDSETLED:
1612 /* AUTOFS */
1613 case AUTOFS_IOC_READY:
1614 case AUTOFS_IOC_FAIL:
1615 /* NBD */ 1579 /* NBD */
1616 case NBD_SET_SOCK: 1580 case NBD_SET_SOCK:
1617 case NBD_SET_BLKSIZE: 1581 case NBD_SET_BLKSIZE: