diff options
author | David Howells <dhowells@redhat.com> | 2006-08-29 14:06:23 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 14:52:29 -0400 |
commit | 52a700c5675f399c07e6e57328291e57f13ef3bb (patch) | |
tree | 4ef1a3a7d66f589ad2e5f7d769da8c30f172a70e /fs/ext3 | |
parent | e322ff07fb2d0f05c02d85e7c6b30d23f308c20f (diff) |
[PATCH] BLOCK: Move the Ext3 device ioctl compat stuff to the Ext3 driver [try #6]
Move the Ext3 device ioctl compat stuff from fs/compat_ioctl.c to the Ext3
driver so that the Ext3 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/ext3')
-rw-r--r-- | fs/ext3/dir.c | 3 | ||||
-rw-r--r-- | fs/ext3/file.c | 3 | ||||
-rw-r--r-- | fs/ext3/ioctl.c | 55 |
3 files changed, 60 insertions, 1 deletions
diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c index 429acbb4e064..d0b54f30b914 100644 --- a/fs/ext3/dir.c +++ b/fs/ext3/dir.c | |||
@@ -44,6 +44,9 @@ const struct file_operations ext3_dir_operations = { | |||
44 | .read = generic_read_dir, | 44 | .read = generic_read_dir, |
45 | .readdir = ext3_readdir, /* we take BKL. needed?*/ | 45 | .readdir = ext3_readdir, /* we take BKL. needed?*/ |
46 | .ioctl = ext3_ioctl, /* BKL held */ | 46 | .ioctl = ext3_ioctl, /* BKL held */ |
47 | #ifdef CONFIG_COMPAT | ||
48 | .compat_ioctl = ext3_compat_ioctl, | ||
49 | #endif | ||
47 | .fsync = ext3_sync_file, /* BKL held */ | 50 | .fsync = ext3_sync_file, /* BKL held */ |
48 | #ifdef CONFIG_EXT3_INDEX | 51 | #ifdef CONFIG_EXT3_INDEX |
49 | .release = ext3_release_dir, | 52 | .release = ext3_release_dir, |
diff --git a/fs/ext3/file.c b/fs/ext3/file.c index 994efd189f4e..74ff20f9d09b 100644 --- a/fs/ext3/file.c +++ b/fs/ext3/file.c | |||
@@ -114,6 +114,9 @@ const struct file_operations ext3_file_operations = { | |||
114 | .readv = generic_file_readv, | 114 | .readv = generic_file_readv, |
115 | .writev = generic_file_writev, | 115 | .writev = generic_file_writev, |
116 | .ioctl = ext3_ioctl, | 116 | .ioctl = ext3_ioctl, |
117 | #ifdef CONFIG_COMPAT | ||
118 | .compat_ioctl = ext3_compat_ioctl, | ||
119 | #endif | ||
117 | .mmap = generic_file_mmap, | 120 | .mmap = generic_file_mmap, |
118 | .open = generic_file_open, | 121 | .open = generic_file_open, |
119 | .release = ext3_release_file, | 122 | .release = ext3_release_file, |
diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c index 3a6b012d120c..12daa6869572 100644 --- a/fs/ext3/ioctl.c +++ b/fs/ext3/ioctl.c | |||
@@ -13,9 +13,10 @@ | |||
13 | #include <linux/ext3_fs.h> | 13 | #include <linux/ext3_fs.h> |
14 | #include <linux/ext3_jbd.h> | 14 | #include <linux/ext3_jbd.h> |
15 | #include <linux/time.h> | 15 | #include <linux/time.h> |
16 | #include <linux/compat.h> | ||
17 | #include <linux/smp_lock.h> | ||
16 | #include <asm/uaccess.h> | 18 | #include <asm/uaccess.h> |
17 | 19 | ||
18 | |||
19 | int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, | 20 | int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, |
20 | unsigned long arg) | 21 | unsigned long arg) |
21 | { | 22 | { |
@@ -252,3 +253,55 @@ flags_err: | |||
252 | return -ENOTTY; | 253 | return -ENOTTY; |
253 | } | 254 | } |
254 | } | 255 | } |
256 | |||
257 | #ifdef CONFIG_COMPAT | ||
258 | long ext3_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
259 | { | ||
260 | struct inode *inode = file->f_dentry->d_inode; | ||
261 | int ret; | ||
262 | |||
263 | /* These are just misnamed, they actually get/put from/to user an int */ | ||
264 | switch (cmd) { | ||
265 | case EXT3_IOC32_GETFLAGS: | ||
266 | cmd = EXT3_IOC_GETFLAGS; | ||
267 | break; | ||
268 | case EXT3_IOC32_SETFLAGS: | ||
269 | cmd = EXT3_IOC_SETFLAGS; | ||
270 | break; | ||
271 | case EXT3_IOC32_GETVERSION: | ||
272 | cmd = EXT3_IOC_GETVERSION; | ||
273 | break; | ||
274 | case EXT3_IOC32_SETVERSION: | ||
275 | cmd = EXT3_IOC_SETVERSION; | ||
276 | break; | ||
277 | case EXT3_IOC32_GROUP_EXTEND: | ||
278 | cmd = EXT3_IOC_GROUP_EXTEND; | ||
279 | break; | ||
280 | case EXT3_IOC32_GETVERSION_OLD: | ||
281 | cmd = EXT3_IOC_GETVERSION_OLD; | ||
282 | break; | ||
283 | case EXT3_IOC32_SETVERSION_OLD: | ||
284 | cmd = EXT3_IOC_SETVERSION_OLD; | ||
285 | break; | ||
286 | #ifdef CONFIG_JBD_DEBUG | ||
287 | case EXT3_IOC32_WAIT_FOR_READONLY: | ||
288 | cmd = EXT3_IOC_WAIT_FOR_READONLY; | ||
289 | break; | ||
290 | #endif | ||
291 | case EXT3_IOC32_GETRSVSZ: | ||
292 | cmd = EXT3_IOC_GETRSVSZ; | ||
293 | break; | ||
294 | case EXT3_IOC32_SETRSVSZ: | ||
295 | cmd = EXT3_IOC_SETRSVSZ; | ||
296 | break; | ||
297 | case EXT3_IOC_GROUP_ADD: | ||
298 | break; | ||
299 | default: | ||
300 | return -ENOIOCTLCMD; | ||
301 | } | ||
302 | lock_kernel(); | ||
303 | ret = ext3_ioctl(inode, file, cmd, (unsigned long) compat_ptr(arg)); | ||
304 | unlock_kernel(); | ||
305 | return ret; | ||
306 | } | ||
307 | #endif | ||