summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authorColin Ian King <[email protected]>2016-03-30 23:00:23 +0100
committerNed Bass <[email protected]>2016-05-01 18:26:09 -0400
commit354424de5a744abf577a116389eb5902aea6b7f8 (patch)
tree9fa8461298a4ee70aad833f5ae2b8f6c58786935 /module/zfs
parentd746e2ea0e7a564888f078fc96a280ff85d0e6dd (diff)
Add support 32 bit FS_IOC32_{GET|SET}FLAGS compat ioctls
We need 32 bit userspace FS_IOC32_GETFLAGS and FS_IOC32_SETFLAGS compat ioctls for systems such as powerpc64. We use the normal compat ioctl idiom as used by a variety of file systems to provide this support. Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4477
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/zpl_file.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c
index a23bc7d8d..5c430c7ca 100644
--- a/module/zfs/zpl_file.c
+++ b/module/zfs/zpl_file.c
@@ -24,6 +24,9 @@
*/
+#ifdef CONFIG_COMPAT
+#include <linux/compat.h>
+#endif
#include <sys/dmu_objset.h>
#include <sys/zfs_vfsops.h>
#include <sys/zfs_vnops.h>
@@ -798,7 +801,17 @@ zpl_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
static long
zpl_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
- return (zpl_ioctl(filp, cmd, arg));
+ switch (cmd) {
+ case FS_IOC32_GETFLAGS:
+ cmd = FS_IOC_GETFLAGS;
+ break;
+ case FS_IOC32_SETFLAGS:
+ cmd = FS_IOC_SETFLAGS;
+ break;
+ default:
+ return (-ENOTTY);
+ }
+ return (zpl_ioctl(filp, cmd, (unsigned long)compat_ptr(arg)));
}
#endif /* CONFIG_COMPAT */