Guido Guenther
2005-Apr-21 12:02 UTC
[PATCH]: ioctl wrappers for EXT3_IOC_GROUP_{EXTEND,ADD}
Hi Andreas, I need the following patch to make ext3 online resizing work with linux 2.6.11.6 on amd64 with a 32bit userland. Do the changes look o.k.? I converted everything to ext3 since it should implement the calls for ext2 in a compatible way and we only have to include ext3 headers then. The COMPATIBLE_IOCTL() should probably into compat_ioctl.h, I'll send an updated version in case these changes look ok. Cheers, -- Guido --- linux-2.6.11.6/fs/compat_ioctl.c.orig 2005-04-21 11:06:23.000000000 +0200 +++ linux-2.6.11.6/fs/compat_ioctl.c 2005-04-21 11:06:07.000000000 +0200 @@ -48,7 +48,8 @@ #include <linux/tty.h> #include <linux/vt_kern.h> #include <linux/fb.h> -#include <linux/ext2_fs.h> +#include <linux/ext3_jbd.h> +#include <linux/ext3_fs.h> #include <linux/videodev.h> #include <linux/netdevice.h> #include <linux/raw.h> @@ -127,10 +127,13 @@ #ifdef CODE /* Aiee. Someone does not find a difference between int and long */ -#define EXT2_IOC32_GETFLAGS _IOR('f', 1, int) -#define EXT2_IOC32_SETFLAGS _IOW('f', 2, int) -#define EXT2_IOC32_GETVERSION _IOR('v', 1, int) -#define EXT2_IOC32_SETVERSION _IOW('v', 2, int) +#define EXT3_IOC32_GETFLAGS _IOR('f', 1, int) +#define EXT3_IOC32_SETFLAGS _IOW('f', 2, int) +#define EXT3_IOC32_GETVERSION _IOR('f', 3, int) +#define EXT3_IOC32_SETVERSION _IOW('f', 4, int) +#define EXT3_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int) +#define EXT3_IOC32_GETVERSION_OLD _IOR('v', 1, int) +#define EXT3_IOC32_SETVERSION_OLD _IOW('v', 2, int) static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg) { @@ -163,14 +166,17 @@ return err; } -static int do_ext2_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) +static int do_ext3_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) { /* These are just misnamed, they actually get/put from/to user an int */ switch (cmd) { - case EXT2_IOC32_GETFLAGS: cmd = EXT2_IOC_GETFLAGS; break; - case EXT2_IOC32_SETFLAGS: cmd = EXT2_IOC_SETFLAGS; break; - case EXT2_IOC32_GETVERSION: cmd = EXT2_IOC_GETVERSION; break; - case EXT2_IOC32_SETVERSION: cmd = EXT2_IOC_SETVERSION; break; + case EXT3_IOC32_GETFLAGS: cmd = EXT3_IOC_GETFLAGS; break; + case EXT3_IOC32_SETFLAGS: cmd = EXT3_IOC_SETFLAGS; break; + case EXT3_IOC32_GETVERSION: cmd = EXT3_IOC_GETVERSION; break; + case EXT3_IOC32_SETVERSION: cmd = EXT3_IOC_SETVERSION; break; + case EXT3_IOC32_GROUP_EXTEND: cmd= EXT3_IOC_GROUP_EXTEND; break; + case EXT3_IOC32_GETVERSION_OLD: cmd = EXT3_IOC_GETVERSION_OLD; break; + case EXT3_IOC32_SETVERSION_OLD: cmd = EXT3_IOC_SETVERSION_OLD; break; } return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg)); } @@ -3274,10 +3280,12 @@ HANDLE_IOCTL(GIO_UNIMAP, do_unimap_ioctl) HANDLE_IOCTL(KDFONTOP, do_kdfontop_ioctl) #endif -HANDLE_IOCTL(EXT2_IOC32_GETFLAGS, do_ext2_ioctl) -HANDLE_IOCTL(EXT2_IOC32_SETFLAGS, do_ext2_ioctl) -HANDLE_IOCTL(EXT2_IOC32_GETVERSION, do_ext2_ioctl) -HANDLE_IOCTL(EXT2_IOC32_SETVERSION, do_ext2_ioctl) +HANDLE_IOCTL(EXT3_IOC32_GETFLAGS, do_ext3_ioctl) +HANDLE_IOCTL(EXT3_IOC32_SETFLAGS, do_ext3_ioctl) +HANDLE_IOCTL(EXT3_IOC32_GETVERSION, do_ext3_ioctl) +HANDLE_IOCTL(EXT3_IOC32_SETVERSION, do_ext3_ioctl) +HANDLE_IOCTL(EXT3_IOC32_GROUP_EXTEND, do_ext3_ioctl) +COMPATIBLE_IOCTL(EXT3_IOC_GROUP_ADD) HANDLE_IOCTL(VIDIOCGTUNER32, do_video_ioctl) HANDLE_IOCTL(VIDIOCSTUNER32, do_video_ioctl) HANDLE_IOCTL(VIDIOCGWIN32, do_video_ioctl) Cheers, -- Guido P.S.: I'm not subscribed to ext3-users
Andreas Dilger
2005-Apr-27 19:59 UTC
[PATCH]: ioctl wrappers for EXT3_IOC_GROUP_{EXTEND,ADD}
On Apr 21, 2005 14:02 +0200, Guido Guenther wrote:> I need the following patch to make ext3 online resizing work with > linux 2.6.11.6 on amd64 with a 32bit userland. Do the changes look o.k.?To be honest, I don't know much about the 32/64-bit ioctl issues. It's too bad this wasn't caught before the ioctls were added in the first place. Maybe in addition to this a comment should be put into ext[23]_ioctl() and/or ext3_fs.h to make it clear what the right ioctl definition is, to avoid the need for this in the future? Cheers, Andreas -- Andreas Dilger Principal Software Engineer Cluster File Systems, Inc. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://listman.redhat.com/archives/ext3-users/attachments/20050427/bf095b00/attachment.sig>