aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/Makefile2
-rw-r--r--fs/compat_ioctl.c37
2 files changed, 22 insertions, 17 deletions
diff --git a/fs/Makefile b/fs/Makefile
index 35e9aec608e4..1db711319c80 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -14,7 +14,7 @@ obj-y := open.o read_write.o file_table.o buffer.o bio.o super.o \
14 14
15obj-$(CONFIG_INOTIFY) += inotify.o 15obj-$(CONFIG_INOTIFY) += inotify.o
16obj-$(CONFIG_EPOLL) += eventpoll.o 16obj-$(CONFIG_EPOLL) += eventpoll.o
17obj-$(CONFIG_COMPAT) += compat.o 17obj-$(CONFIG_COMPAT) += compat.o compat_ioctl.o
18 18
19nfsd-$(CONFIG_NFSD) := nfsctl.o 19nfsd-$(CONFIG_NFSD) := nfsctl.o
20obj-y += $(nfsd-y) $(nfsd-m) 20obj-y += $(nfsd-y) $(nfsd-m)
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index b9aeacc11c8f..890bc30fbe20 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -10,7 +10,6 @@
10 * ioctls. 10 * ioctls.
11 */ 11 */
12 12
13#ifdef INCLUDES
14#include <linux/config.h> 13#include <linux/config.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/compat.h> 15#include <linux/compat.h>
@@ -81,13 +80,9 @@
81#include <linux/capi.h> 80#include <linux/capi.h>
82 81
83#include <scsi/scsi.h> 82#include <scsi/scsi.h>
84/* Ugly hack. */
85#undef __KERNEL__
86#include <scsi/scsi_ioctl.h> 83#include <scsi/scsi_ioctl.h>
87#define __KERNEL__
88#include <scsi/sg.h> 84#include <scsi/sg.h>
89 85
90#include <asm/types.h>
91#include <asm/uaccess.h> 86#include <asm/uaccess.h>
92#include <linux/ethtool.h> 87#include <linux/ethtool.h>
93#include <linux/mii.h> 88#include <linux/mii.h>
@@ -95,7 +90,6 @@
95#include <linux/watchdog.h> 90#include <linux/watchdog.h>
96#include <linux/dm-ioctl.h> 91#include <linux/dm-ioctl.h>
97 92
98#include <asm/module.h>
99#include <linux/soundcard.h> 93#include <linux/soundcard.h>
100#include <linux/lp.h> 94#include <linux/lp.h>
101#include <linux/ppdev.h> 95#include <linux/ppdev.h>
@@ -128,11 +122,6 @@
128#include <linux/dvb/frontend.h> 122#include <linux/dvb/frontend.h>
129#include <linux/dvb/video.h> 123#include <linux/dvb/video.h>
130 124
131#undef INCLUDES
132#endif
133
134#ifdef CODE
135
136/* Aiee. Someone does not find a difference between int and long */ 125/* Aiee. Someone does not find a difference between int and long */
137#define EXT2_IOC32_GETFLAGS _IOR('f', 1, int) 126#define EXT2_IOC32_GETFLAGS _IOR('f', 1, int)
138#define EXT2_IOC32_SETFLAGS _IOW('f', 2, int) 127#define EXT2_IOC32_SETFLAGS _IOW('f', 2, int)
@@ -148,6 +137,12 @@
148#define EXT2_IOC32_GETVERSION _IOR('v', 1, int) 137#define EXT2_IOC32_GETVERSION _IOR('v', 1, int)
149#define EXT2_IOC32_SETVERSION _IOW('v', 2, int) 138#define EXT2_IOC32_SETVERSION _IOW('v', 2, int)
150 139
140static int do_ioctl32_pointer(unsigned int fd, unsigned int cmd,
141 unsigned long arg, struct file *f)
142{
143 return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg));
144}
145
151static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg) 146static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg)
152{ 147{
153 mm_segment_t old_fs = get_fs(); 148 mm_segment_t old_fs = get_fs();
@@ -2705,10 +2700,20 @@ static int do_ncp_setprivatedata(unsigned int fd, unsigned int cmd, unsigned lon
2705} 2700}
2706#endif 2701#endif
2707 2702
2708#undef CODE 2703#define HANDLE_IOCTL(cmd,handler) \
2709#endif 2704 { (cmd), (ioctl_trans_handler_t)(handler) },
2705
2706/* pointer to compatible structure or no argument */
2707#define COMPATIBLE_IOCTL(cmd) \
2708 { (cmd), do_ioctl32_pointer },
2709
2710/* argument is an unsigned long integer, not a pointer */
2711#define ULONG_IOCTL(cmd) \
2712 { (cmd), (ioctl_trans_handler_t)sys_ioctl },
2710 2713
2711#ifdef DECLARES 2714
2715struct ioctl_trans ioctl_start[] = {
2716#include <linux/compat_ioctl.h>
2712HANDLE_IOCTL(MEMREADOOB32, mtd_rw_oob) 2717HANDLE_IOCTL(MEMREADOOB32, mtd_rw_oob)
2713HANDLE_IOCTL(MEMWRITEOOB32, mtd_rw_oob) 2718HANDLE_IOCTL(MEMWRITEOOB32, mtd_rw_oob)
2714#ifdef CONFIG_NET 2719#ifdef CONFIG_NET
@@ -2921,6 +2926,6 @@ HANDLE_IOCTL(DMX_GET_EVENT, do_dmx_get_event)
2921HANDLE_IOCTL(VIDEO_GET_EVENT, do_video_get_event) 2926HANDLE_IOCTL(VIDEO_GET_EVENT, do_video_get_event)
2922HANDLE_IOCTL(VIDEO_STILLPICTURE, do_video_stillpicture) 2927HANDLE_IOCTL(VIDEO_STILLPICTURE, do_video_stillpicture)
2923HANDLE_IOCTL(VIDEO_SET_SPU_PALETTE, do_video_set_spu_palette) 2928HANDLE_IOCTL(VIDEO_SET_SPU_PALETTE, do_video_set_spu_palette)
2929};
2924 2930
2925#undef DECLARES 2931int ioctl_table_size = ARRAY_SIZE(ioctl_start);
2926#endif