summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/ioctl.c
diff options
context:
space:
mode:
authorMark Fasheh2007-03-10 00:56:28 +0100
committerMark Fasheh2007-05-03 00:07:16 +0200
commit586d232b191b776a1c6d51c10c662b8b3e238fdf (patch)
tree8963261875e046d405d6e23b7ee67ff7c03f5c91 /fs/ocfs2/ioctl.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/iee... (diff)
downloadkernel-qcow2-linux-586d232b191b776a1c6d51c10c662b8b3e238fdf.tar.gz
kernel-qcow2-linux-586d232b191b776a1c6d51c10c662b8b3e238fdf.tar.xz
kernel-qcow2-linux-586d232b191b776a1c6d51c10c662b8b3e238fdf.zip
ocfs2: Implement compat_ioctl()
We need this to support 32 bit system calls on 64 bit kernels. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/ioctl.c')
-rw-r--r--fs/ocfs2/ioctl.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index 4768be5f3086..7e59c93751f0 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -134,3 +134,26 @@ int ocfs2_ioctl(struct inode * inode, struct file * filp,
}
}
+#ifdef CONFIG_COMPAT
+long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
+{
+ struct inode *inode = file->f_path.dentry->d_inode;
+ int ret;
+
+ switch (cmd) {
+ case OCFS2_IOC32_GETFLAGS:
+ cmd = OCFS2_IOC_GETFLAGS;
+ break;
+ case OCFS2_IOC32_SETFLAGS:
+ cmd = OCFS2_IOC_SETFLAGS;
+ break;
+ default:
+ return -ENOIOCTLCMD;
+ }
+
+ lock_kernel();
+ ret = ocfs2_ioctl(inode, file, cmd, arg);
+ unlock_kernel();
+ return ret;
+}
+#endif