mtd: Handle compat ioctls directly; remove all trace from compat_ioctl.c

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri May 29 11:59:09 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=668ff9ab45d595222d3f90d7974ccba3518e3bb3
Commit:     668ff9ab45d595222d3f90d7974ccba3518e3bb3
Parent:     aea7cea9fa9e39e71f95ad70b3daf98ba9972587
Author:     Kevin Cernekee <kpc.mtd at gmail.com>
AuthorDate: Tue Apr 14 21:59:22 2009 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri May 29 15:58:25 2009 +0100

    mtd: Handle compat ioctls directly; remove all trace from compat_ioctl.c
    
    Remove all references to MTD ioctls from fs/compat_ioctl.c and let
    them all be handled by mtd_compat_ioctl().
    
    Signed-off-by: Kevin Cernekee <kpc.mtd at gmail.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/mtdchar.c |    3 ++-
 fs/compat_ioctl.c     |   22 ----------------------
 2 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 99d1fbc..5fff04f 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -836,6 +836,7 @@ struct mtd_oob_buf32 {
 static long mtd_compat_ioctl(struct file *file, unsigned int cmd,
 	unsigned long arg)
 {
+	struct inode *inode = file->f_path.dentry->d_inode;
 	struct mtd_file_info *mfi = file->private_data;
 	struct mtd_info *mtd = mfi->mtd;
 	void __user *argp = (void __user *)arg;
@@ -873,7 +874,7 @@ static long mtd_compat_ioctl(struct file *file, unsigned int cmd,
 		break;
 	}
 	default:
-		ret = -ENOIOCTLCMD;
+		ret = mtd_ioctl(inode, file, cmd, arg);
 	}
 
 	unlock_kernel();
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 8da222e..aa6ba39 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -94,7 +94,6 @@
 #include <linux/atm_tcp.h>
 #include <linux/sonet.h>
 #include <linux/atm_suni.h>
-#include <linux/mtd/mtd.h>
 
 #include <linux/usb.h>
 #include <linux/usbdevice_fs.h>
@@ -2392,27 +2391,6 @@ COMPATIBLE_IOCTL(USBDEVFS_SUBMITURB32)
 COMPATIBLE_IOCTL(USBDEVFS_REAPURB32)
 COMPATIBLE_IOCTL(USBDEVFS_REAPURBNDELAY32)
 COMPATIBLE_IOCTL(USBDEVFS_CLEAR_HALT)
-/* MTD */
-COMPATIBLE_IOCTL(MEMGETINFO)
-COMPATIBLE_IOCTL(MEMERASE)
-COMPATIBLE_IOCTL(MEMLOCK)
-COMPATIBLE_IOCTL(MEMUNLOCK)
-COMPATIBLE_IOCTL(MEMGETREGIONCOUNT)
-COMPATIBLE_IOCTL(MEMGETREGIONINFO)
-COMPATIBLE_IOCTL(MEMSETOOBSEL)
-COMPATIBLE_IOCTL(MEMGETOOBSEL)
-COMPATIBLE_IOCTL(MEMGETBADBLOCK)
-COMPATIBLE_IOCTL(MEMSETBADBLOCK)
-COMPATIBLE_IOCTL(OTPSELECT)
-COMPATIBLE_IOCTL(OTPGETREGIONCOUNT)
-COMPATIBLE_IOCTL(OTPGETREGIONINFO)
-COMPATIBLE_IOCTL(OTPLOCK)
-COMPATIBLE_IOCTL(ECCGETLAYOUT)
-COMPATIBLE_IOCTL(ECCGETSTATS)
-COMPATIBLE_IOCTL(MTDFILEMODE)
-COMPATIBLE_IOCTL(MEMERASE64)
-COMPATIBLE_IOCTL(MEMREADOOB64)
-COMPATIBLE_IOCTL(MEMWRITEOOB64)
 /* NBD */
 ULONG_IOCTL(NBD_SET_SOCK)
 ULONG_IOCTL(NBD_SET_BLKSIZE)



More information about the linux-mtd-cvs mailing list