Similar to the compat handlers of other file systems. The ioctls are compatible except that they have different numbers. Cc: sfrench@samba.org Signed-off-by: Andi Kleen <ak@suse.de> --- fs/cifs/cifsfs.c | 15 +++++++++++++++ fs/cifs/cifsfs.h | 2 ++ fs/cifs/ioctl.c | 19 +++++++++++++++++++ 3 files changed, 36 insertions(+) Index: linux/fs/cifs/cifsfs.c =================================================================== --- linux.orig/fs/cifs/cifsfs.c +++ linux/fs/cifs/cifsfs.c @@ -626,6 +626,9 @@ const struct file_operations cifs_file_o .llseek = cifs_llseek, #ifdef CONFIG_CIFS_POSIX .unlocked_ioctl = cifs_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = cifs_compat_ioctl, +#endif #endif /* CONFIG_CIFS_POSIX */ #ifdef CONFIG_CIFS_EXPERIMENTAL @@ -646,6 +649,9 @@ const struct file_operations cifs_file_d .splice_read = generic_file_splice_read, #ifdef CONFIG_CIFS_POSIX .unlocked_ioctl = cifs_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = cifs_compat_ioctl, +#endif #endif /* CONFIG_CIFS_POSIX */ .llseek = cifs_llseek, #ifdef CONFIG_CIFS_EXPERIMENTAL @@ -666,6 +672,9 @@ const struct file_operations cifs_file_n .llseek = cifs_llseek, #ifdef CONFIG_CIFS_POSIX .unlocked_ioctl = cifs_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = cifs_compat_ioctl, +#endif #endif /* CONFIG_CIFS_POSIX */ #ifdef CONFIG_CIFS_EXPERIMENTAL @@ -685,6 +694,9 @@ const struct file_operations cifs_file_d .splice_read = generic_file_splice_read, #ifdef CONFIG_CIFS_POSIX .unlocked_ioctl = cifs_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = cifs_compat_ioctl, +#endif #endif /* CONFIG_CIFS_POSIX */ .llseek = cifs_llseek, #ifdef CONFIG_CIFS_EXPERIMENTAL @@ -700,6 +712,9 @@ const struct file_operations cifs_dir_op .dir_notify = cifs_dir_notify, #endif /* CONFIG_CIFS_EXPERIMENTAL */ .unlocked_ioctl = cifs_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = cifs_compat_ioctl, +#endif }; static void Index: linux/fs/cifs/cifsfs.h =================================================================== --- linux.orig/fs/cifs/cifsfs.h +++ linux/fs/cifs/cifsfs.h @@ -101,6 +101,8 @@ extern ssize_t cifs_getxattr(struct dent extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); extern long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg); +extern long cifs_compat_ioctl(struct file *filep, unsigned int command, + unsigned long arg); #ifdef CONFIG_CIFS_EXPERIMENTAL extern const struct export_operations cifs_export_ops; Index: linux/fs/cifs/ioctl.c =================================================================== --- linux.orig/fs/cifs/ioctl.c +++ linux/fs/cifs/ioctl.c @@ -108,3 +108,22 @@ long cifs_ioctl(struct file *filep, unsi FreeXid(xid); return rc; } + +#ifdef CONFIG_COMPAT +#define FS_IOC_GETFLAGS32 _IOR('f', 1, int) +#define FS_IOC_SETFLAGS32 _IOR('f', 2, int) + +long cifs_compat_ioctl(struct file *f, unsigned int command, unsigned long arg) +{ + /* Native ioctl is just mistyped, the real type is always int */ + switch (command) { + case FS_IOC_GETFLAGS32: + command = FS_IOC_GETFLAGS; + break; + case FS_IOC_SETFLAGS32: + command = FS_IOC_SETFLAGS; + break; + } + return cifs_ioctl(f, command, arg); +} +#endif - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Glauber de Oliveira Costa | [PATCH 0/19] desc_struct integration |
| Paolo Ornati | Re: [patch 00/69] -stable review |
| Ingo Molnar | [patch] CFS scheduler, -v6 |
git: | |
| Denis Bueno | git-instaweb portability issue (maybe?) |
| Jon Smirl | Re: Inconsistencies with git log |
| Johannes Schindelin | Re: [PATCH] Fix premature call to git_config() causing t1020-subdirectory to fail |
| Dan Farina | backup or mirror a repository |
| Marc Espie | Re: That whole "Linux stealing our code" thing |
| Ray Percival | Re: Real men don't attack straw men |
| askthelist | Packets Per Second Limit? |
| Didier Wiroth | how can I "find xyz | xargs tar" ... like gtar |
| Marcel Holtmann | Bluetooth fixes for 2.6.27 |
| Giacomo A. Catenazzi | Re: [BUG] New Kernel Bugs |
| Tilman Schmidt | Re: 2.6.25-rc8: FTP transfer errors |
| Ingo Oeser | Re: [PATCH]: Third (final?) release of Sun Neptune driver |
| high memory | 10 hours ago | Linux kernel |
| semaphore access speed | 13 hours ago | Applications and Utilities |
| the kernel how to power off the machine | 14 hours ago | Linux kernel |
| Easter Eggs in windows XP | 17 hours ago | Windows |
| Shared swap partition | 18 hours ago | Linux general |
| Root password | 18 hours ago | Linux general |
| Where/when DNOTIFY is used? | 20 hours ago | Linux kernel |
| How to convert Linux Kernel built-in module into a loadable module | 22 hours ago | Linux kernel |
| Linux 2.6.24 and I/O schedulers | 23 hours ago | Linux kernel |
| USB Driver -- Interrupt Polling -- A Little Help Please | 1 day ago | Linux general |
