aboutsummaryrefslogtreecommitdiffstats
path: root/fs/compat_ioctl.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2005-11-17 18:04:34 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2005-11-17 18:04:34 -0500
commitd5ea655376c471731845735dfe9a0bdfbe4492e9 (patch)
tree27564e45ef7656c9130edad80a5f1495f927f3ef /fs/compat_ioctl.c
parent6b1de9161e973bac8c4675db608fe4f38d2689bd (diff)
[COMPAT]: Add ext3 ioctl translations.
So things like on-line resizing et al. work. Based almost entirely upon a patch by Guido Günther <agx@sigxcpu.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/compat_ioctl.c')
-rw-r--r--fs/compat_ioctl.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index f07e60f9e102..991c00de5c4e 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -49,6 +49,8 @@
49#include <linux/vt_kern.h> 49#include <linux/vt_kern.h>
50#include <linux/fb.h> 50#include <linux/fb.h>
51#include <linux/ext2_fs.h> 51#include <linux/ext2_fs.h>
52#include <linux/ext3_jbd.h>
53#include <linux/ext3_fs.h>
52#include <linux/videodev.h> 54#include <linux/videodev.h>
53#include <linux/netdevice.h> 55#include <linux/netdevice.h>
54#include <linux/raw.h> 56#include <linux/raw.h>
@@ -134,6 +136,15 @@
134/* Aiee. Someone does not find a difference between int and long */ 136/* Aiee. Someone does not find a difference between int and long */
135#define EXT2_IOC32_GETFLAGS _IOR('f', 1, int) 137#define EXT2_IOC32_GETFLAGS _IOR('f', 1, int)
136#define EXT2_IOC32_SETFLAGS _IOW('f', 2, int) 138#define EXT2_IOC32_SETFLAGS _IOW('f', 2, int)
139#define EXT3_IOC32_GETVERSION _IOR('f', 3, int)
140#define EXT3_IOC32_SETVERSION _IOR('f', 4, int)
141#define EXT3_IOC32_GETRSVSZ _IOR('f', 5, int)
142#define EXT3_IOC32_SETRSVSZ _IOW('f', 6, int)
143#define EXT3_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
144#ifdef CONFIG_JBD_DEBUG
145#define EXT3_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int)
146#endif
147
137#define EXT2_IOC32_GETVERSION _IOR('v', 1, int) 148#define EXT2_IOC32_GETVERSION _IOR('v', 1, int)
138#define EXT2_IOC32_SETVERSION _IOW('v', 2, int) 149#define EXT2_IOC32_SETVERSION _IOW('v', 2, int)
139 150
@@ -180,6 +191,22 @@ static int do_ext2_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
180 return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg)); 191 return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg));
181} 192}
182 193
194static int do_ext3_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
195{
196 /* These are just misnamed, they actually get/put from/to user an int */
197 switch (cmd) {
198 case EXT3_IOC32_GETVERSION: cmd = EXT3_IOC_GETVERSION; break;
199 case EXT3_IOC32_SETVERSION: cmd = EXT3_IOC_SETVERSION; break;
200 case EXT3_IOC32_GETRSVSZ: cmd = EXT3_IOC_GETRSVSZ; break;
201 case EXT3_IOC32_SETRSVSZ: cmd = EXT3_IOC_SETRSVSZ; break;
202 case EXT3_IOC32_GROUP_EXTEND: cmd = EXT3_IOC_GROUP_EXTEND; break;
203#ifdef CONFIG_JBD_DEBUG
204 case EXT3_IOC32_WAIT_FOR_READONLY: cmd = EXT3_IOC_WAIT_FOR_READONLY; break;
205#endif
206 }
207 return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg));
208}
209
183struct video_tuner32 { 210struct video_tuner32 {
184 compat_int_t tuner; 211 compat_int_t tuner;
185 char name[32]; 212 char name[32];
@@ -2981,6 +3008,15 @@ HANDLE_IOCTL(EXT2_IOC32_GETFLAGS, do_ext2_ioctl)
2981HANDLE_IOCTL(EXT2_IOC32_SETFLAGS, do_ext2_ioctl) 3008HANDLE_IOCTL(EXT2_IOC32_SETFLAGS, do_ext2_ioctl)
2982HANDLE_IOCTL(EXT2_IOC32_GETVERSION, do_ext2_ioctl) 3009HANDLE_IOCTL(EXT2_IOC32_GETVERSION, do_ext2_ioctl)
2983HANDLE_IOCTL(EXT2_IOC32_SETVERSION, do_ext2_ioctl) 3010HANDLE_IOCTL(EXT2_IOC32_SETVERSION, do_ext2_ioctl)
3011HANDLE_IOCTL(EXT3_IOC32_GETVERSION, do_ext3_ioctl)
3012HANDLE_IOCTL(EXT3_IOC32_SETVERSION, do_ext3_ioctl)
3013HANDLE_IOCTL(EXT3_IOC32_GETRSVSZ, do_ext3_ioctl)
3014HANDLE_IOCTL(EXT3_IOC32_SETRSVSZ, do_ext3_ioctl)
3015HANDLE_IOCTL(EXT3_IOC32_GROUP_EXTEND, do_ext3_ioctl)
3016COMPATIBLE_IOCTL(EXT3_IOC_GROUP_ADD)
3017#ifdef CONFIG_JBD_DEBUG
3018HANDLE_IOCTL(EXT3_IOC32_WAIT_FOR_READONLY, do_ext3_ioctl)
3019#endif
2984HANDLE_IOCTL(VIDIOCGTUNER32, do_video_ioctl) 3020HANDLE_IOCTL(VIDIOCGTUNER32, do_video_ioctl)
2985HANDLE_IOCTL(VIDIOCSTUNER32, do_video_ioctl) 3021HANDLE_IOCTL(VIDIOCSTUNER32, do_video_ioctl)
2986HANDLE_IOCTL(VIDIOCGWIN32, do_video_ioctl) 3022HANDLE_IOCTL(VIDIOCGWIN32, do_video_ioctl)