diff options
author | David Howells <dhowells@redhat.com> | 2006-08-29 14:06:20 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 14:52:29 -0400 |
commit | e322ff07fb2d0f05c02d85e7c6b30d23f308c20f (patch) | |
tree | 56c6817342087294f5242dbea9eaaa38098a9046 /fs/ext2/ioctl.c | |
parent | 52b499c438ff60991eb3855ca090782569b3e8cf (diff) |
[PATCH] BLOCK: Move the Ext2 device ioctl compat stuff to the Ext2 driver [try #6]
Move the Ext2 device ioctl compat stuff from fs/compat_ioctl.c to the Ext2
driver so that the Ext2 header file doesn't need to be included.
Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/ext2/ioctl.c')
-rw-r--r-- | fs/ext2/ioctl.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c index 3ca9afdf713d..1dfba77eab10 100644 --- a/fs/ext2/ioctl.c +++ b/fs/ext2/ioctl.c | |||
@@ -11,6 +11,8 @@ | |||
11 | #include <linux/capability.h> | 11 | #include <linux/capability.h> |
12 | #include <linux/time.h> | 12 | #include <linux/time.h> |
13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
14 | #include <linux/compat.h> | ||
15 | #include <linux/smp_lock.h> | ||
14 | #include <asm/current.h> | 16 | #include <asm/current.h> |
15 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
16 | 18 | ||
@@ -80,3 +82,33 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, | |||
80 | return -ENOTTY; | 82 | return -ENOTTY; |
81 | } | 83 | } |
82 | } | 84 | } |
85 | |||
86 | #ifdef CONFIG_COMPAT | ||
87 | long ext2_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
88 | { | ||
89 | struct inode *inode = file->f_dentry->d_inode; | ||
90 | int ret; | ||
91 | |||
92 | /* These are just misnamed, they actually get/put from/to user an int */ | ||
93 | switch (cmd) { | ||
94 | case EXT2_IOC32_GETFLAGS: | ||
95 | cmd = EXT2_IOC_GETFLAGS; | ||
96 | break; | ||
97 | case EXT2_IOC32_SETFLAGS: | ||
98 | cmd = EXT2_IOC_SETFLAGS; | ||
99 | break; | ||
100 | case EXT2_IOC32_GETVERSION: | ||
101 | cmd = EXT2_IOC_GETVERSION; | ||
102 | break; | ||
103 | case EXT2_IOC32_SETVERSION: | ||
104 | cmd = EXT2_IOC_SETVERSION; | ||
105 | break; | ||
106 | default: | ||
107 | return -ENOIOCTLCMD; | ||
108 | } | ||
109 | lock_kernel(); | ||
110 | ret = ext2_ioctl(inode, file, cmd, (unsigned long) compat_ptr(arg)); | ||
111 | unlock_kernel(); | ||
112 | return ret; | ||
113 | } | ||
114 | #endif | ||