diff options
author | David Howells <dhowells@redhat.com> | 2006-08-29 14:06:18 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 14:52:28 -0400 |
commit | 52b499c438ff60991eb3855ca090782569b3e8cf (patch) | |
tree | ce6dde5d3488a0ba0497c4c49d99d3b94ce921c0 /fs/reiserfs/ioctl.c | |
parent | 36695673b012096228ebdc1b39a6a5850daa474e (diff) |
[PATCH] BLOCK: Move the ReiserFS device ioctl compat stuff to the ReiserFS driver [try #6]
Move the ReiserFS device ioctl compat stuff from fs/compat_ioctl.c to the
ReiserFS driver so that the ReiserFS 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/reiserfs/ioctl.c')
-rw-r--r-- | fs/reiserfs/ioctl.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c index a986b5e1e288..9c57578cb831 100644 --- a/fs/reiserfs/ioctl.c +++ b/fs/reiserfs/ioctl.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <asm/uaccess.h> | 9 | #include <asm/uaccess.h> |
10 | #include <linux/pagemap.h> | 10 | #include <linux/pagemap.h> |
11 | #include <linux/smp_lock.h> | 11 | #include <linux/smp_lock.h> |
12 | #include <linux/compat.h> | ||
12 | 13 | ||
13 | static int reiserfs_unpack(struct inode *inode, struct file *filp); | 14 | static int reiserfs_unpack(struct inode *inode, struct file *filp); |
14 | 15 | ||
@@ -94,6 +95,40 @@ int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
94 | } | 95 | } |
95 | } | 96 | } |
96 | 97 | ||
98 | #ifdef CONFIG_COMPAT | ||
99 | long reiserfs_compat_ioctl(struct file *file, unsigned int cmd, | ||
100 | unsigned long arg) | ||
101 | { | ||
102 | struct inode *inode = file->f_dentry->d_inode; | ||
103 | int ret; | ||
104 | |||
105 | /* These are just misnamed, they actually get/put from/to user an int */ | ||
106 | switch (cmd) { | ||
107 | case REISERFS_IOC32_UNPACK: | ||
108 | cmd = REISERFS_IOC_UNPACK; | ||
109 | break; | ||
110 | case REISERFS_IOC32_GETFLAGS: | ||
111 | cmd = REISERFS_IOC_GETFLAGS; | ||
112 | break; | ||
113 | case REISERFS_IOC32_SETFLAGS: | ||
114 | cmd = REISERFS_IOC_SETFLAGS; | ||
115 | break; | ||
116 | case REISERFS_IOC32_GETVERSION: | ||
117 | cmd = REISERFS_IOC_GETVERSION; | ||
118 | break; | ||
119 | case REISERFS_IOC32_SETVERSION: | ||
120 | cmd = REISERFS_IOC_SETVERSION; | ||
121 | break; | ||
122 | default: | ||
123 | return -ENOIOCTLCMD; | ||
124 | } | ||
125 | lock_kernel(); | ||
126 | ret = reiserfs_ioctl(inode, file, cmd, (unsigned long) compat_ptr(arg)); | ||
127 | unlock_kernel(); | ||
128 | return ret; | ||
129 | } | ||
130 | #endif | ||
131 | |||
97 | /* | 132 | /* |
98 | ** reiserfs_unpack | 133 | ** reiserfs_unpack |
99 | ** Function try to convert tail from direct item into indirect. | 134 | ** Function try to convert tail from direct item into indirect. |