]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
BKL-removal: Implement a compat_ioctl handler for JFS
authorAndi Kleen <ak@suse.de>
Sun, 27 Jan 2008 23:02:02 +0000 (17:02 -0600)
committerDave Kleikamp <shaggy@linux.vnet.ibm.com>
Thu, 7 Feb 2008 19:45:29 +0000 (13:45 -0600)
The ioctls were already compatible except for the actual values so this
was fairly easy to do.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
fs/jfs/file.c
fs/jfs/ioctl.c
fs/jfs/jfs_dinode.h
fs/jfs/jfs_inode.h
fs/jfs/namei.c

index 713ff4c2f80754d0595f339bf7f447977a9eca50..7f6063acaa3b2460c395ced0da2c82bb21a579b2 100644 (file)
@@ -113,4 +113,7 @@ const struct file_operations jfs_file_operations = {
        .fsync          = jfs_fsync,
        .release        = jfs_release,
        .unlocked_ioctl = jfs_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl   = jfs_compat_ioctl,
+#endif
 };
index fc82eccf408acebc5476159650dfe64605c2e77d..a1f8e375ad2114f2e75669f7a817bdf20baa6fdc 100644 (file)
@@ -117,3 +117,21 @@ long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        }
 }
 
+#ifdef CONFIG_COMPAT
+long jfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+{
+       /* While these ioctl numbers defined with 'long' and have different
+        * numbers than the 64bit ABI,
+        * the actual implementation only deals with ints and is compatible.
+        */
+       switch (cmd) {
+       case JFS_IOC_GETFLAGS32:
+               cmd = JFS_IOC_GETFLAGS;
+               break;
+       case JFS_IOC_SETFLAGS32:
+               cmd = JFS_IOC_SETFLAGS;
+               break;
+       }
+       return jfs_ioctl(filp, cmd, arg);
+}
+#endif
index c387540d34255334431ef4f02a995ae7399cb273..395c4c0d0f0667bf0f8e604d2e9b4b3eb1600698 100644 (file)
@@ -170,5 +170,7 @@ struct dinode {
 #define JFS_IOC_GETFLAGS       _IOR('f', 1, long)
 #define JFS_IOC_SETFLAGS       _IOW('f', 2, long)
 
+#define JFS_IOC_GETFLAGS32     _IOR('f', 1, int)
+#define JFS_IOC_SETFLAGS32     _IOW('f', 2, int)
 
 #endif /*_H_JFS_DINODE */
index 570fd5e3ef614fda3566b1cbe21b19ad23e922c1..adb2fafcc54428d2542b76191e93c8ffff3bd454 100644 (file)
@@ -23,6 +23,7 @@ struct fid;
 extern struct inode *ialloc(struct inode *, umode_t);
 extern int jfs_fsync(struct file *, struct dentry *, int);
 extern long jfs_ioctl(struct file *, unsigned int, unsigned long);
+extern long jfs_compat_ioctl(struct file *, unsigned int, unsigned long);
 extern struct inode *jfs_iget(struct super_block *, unsigned long);
 extern int jfs_commit_inode(struct inode *, int);
 extern int jfs_write_inode(struct inode*, int);
index 6440904a051c50ede9495e5d1f7d9414cfa73978..0ba6778edaa2ae73d9595d8f425c7d3e98dce7a7 100644 (file)
@@ -1557,6 +1557,9 @@ const struct file_operations jfs_dir_operations = {
        .readdir        = jfs_readdir,
        .fsync          = jfs_fsync,
        .unlocked_ioctl = jfs_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl   = jfs_compat_ioctl,
+#endif
 };
 
 static int jfs_ci_hash(struct dentry *dir, struct qstr *this)