diff options
author | Mingming Cao <cmm@us.ibm.com> | 2006-10-11 04:20:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-11 14:14:15 -0400 |
commit | 617ba13b31fbf505cc21799826639ef24ed94af0 (patch) | |
tree | 2a41e8c993f7c1eed115ad24047d546ba56cbdf5 /fs/ext4/ioctl.c | |
parent | ac27a0ec112a089f1a5102bc8dffc79c8c815571 (diff) |
[PATCH] ext4: rename ext4 symbols to avoid duplication of ext3 symbols
Mingming Cao originally did this work, and Shaggy reproduced it using some
scripts from her.
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ext4/ioctl.c')
-rw-r--r-- | fs/ext4/ioctl.c | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 12daa6869572..a567af161b06 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/fs/ext3/ioctl.c | 2 | * linux/fs/ext4/ioctl.c |
3 | * | 3 | * |
4 | * Copyright (C) 1993, 1994, 1995 | 4 | * Copyright (C) 1993, 1994, 1995 |
5 | * Remy Card (card@masi.ibp.fr) | 5 | * Remy Card (card@masi.ibp.fr) |
@@ -10,30 +10,30 @@ | |||
10 | #include <linux/fs.h> | 10 | #include <linux/fs.h> |
11 | #include <linux/jbd.h> | 11 | #include <linux/jbd.h> |
12 | #include <linux/capability.h> | 12 | #include <linux/capability.h> |
13 | #include <linux/ext3_fs.h> | 13 | #include <linux/ext4_fs.h> |
14 | #include <linux/ext3_jbd.h> | 14 | #include <linux/ext4_jbd.h> |
15 | #include <linux/time.h> | 15 | #include <linux/time.h> |
16 | #include <linux/compat.h> | 16 | #include <linux/compat.h> |
17 | #include <linux/smp_lock.h> | 17 | #include <linux/smp_lock.h> |
18 | #include <asm/uaccess.h> | 18 | #include <asm/uaccess.h> |
19 | 19 | ||
20 | int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, | 20 | int ext4_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, |
21 | unsigned long arg) | 21 | unsigned long arg) |
22 | { | 22 | { |
23 | struct ext3_inode_info *ei = EXT3_I(inode); | 23 | struct ext4_inode_info *ei = EXT4_I(inode); |
24 | unsigned int flags; | 24 | unsigned int flags; |
25 | unsigned short rsv_window_size; | 25 | unsigned short rsv_window_size; |
26 | 26 | ||
27 | ext3_debug ("cmd = %u, arg = %lu\n", cmd, arg); | 27 | ext4_debug ("cmd = %u, arg = %lu\n", cmd, arg); |
28 | 28 | ||
29 | switch (cmd) { | 29 | switch (cmd) { |
30 | case EXT3_IOC_GETFLAGS: | 30 | case EXT4_IOC_GETFLAGS: |
31 | flags = ei->i_flags & EXT3_FL_USER_VISIBLE; | 31 | flags = ei->i_flags & EXT4_FL_USER_VISIBLE; |
32 | return put_user(flags, (int __user *) arg); | 32 | return put_user(flags, (int __user *) arg); |
33 | case EXT3_IOC_SETFLAGS: { | 33 | case EXT4_IOC_SETFLAGS: { |
34 | handle_t *handle = NULL; | 34 | handle_t *handle = NULL; |
35 | int err; | 35 | int err; |
36 | struct ext3_iloc iloc; | 36 | struct ext4_iloc iloc; |
37 | unsigned int oldflags; | 37 | unsigned int oldflags; |
38 | unsigned int jflag; | 38 | unsigned int jflag; |
39 | 39 | ||
@@ -47,13 +47,13 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, | |||
47 | return -EFAULT; | 47 | return -EFAULT; |
48 | 48 | ||
49 | if (!S_ISDIR(inode->i_mode)) | 49 | if (!S_ISDIR(inode->i_mode)) |
50 | flags &= ~EXT3_DIRSYNC_FL; | 50 | flags &= ~EXT4_DIRSYNC_FL; |
51 | 51 | ||
52 | mutex_lock(&inode->i_mutex); | 52 | mutex_lock(&inode->i_mutex); |
53 | oldflags = ei->i_flags; | 53 | oldflags = ei->i_flags; |
54 | 54 | ||
55 | /* The JOURNAL_DATA flag is modifiable only by root */ | 55 | /* The JOURNAL_DATA flag is modifiable only by root */ |
56 | jflag = flags & EXT3_JOURNAL_DATA_FL; | 56 | jflag = flags & EXT4_JOURNAL_DATA_FL; |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * The IMMUTABLE and APPEND_ONLY flags can only be changed by | 59 | * The IMMUTABLE and APPEND_ONLY flags can only be changed by |
@@ -61,7 +61,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, | |||
61 | * | 61 | * |
62 | * This test looks nicer. Thanks to Pauline Middelink | 62 | * This test looks nicer. Thanks to Pauline Middelink |
63 | */ | 63 | */ |
64 | if ((flags ^ oldflags) & (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL)) { | 64 | if ((flags ^ oldflags) & (EXT4_APPEND_FL | EXT4_IMMUTABLE_FL)) { |
65 | if (!capable(CAP_LINUX_IMMUTABLE)) { | 65 | if (!capable(CAP_LINUX_IMMUTABLE)) { |
66 | mutex_unlock(&inode->i_mutex); | 66 | mutex_unlock(&inode->i_mutex); |
67 | return -EPERM; | 67 | return -EPERM; |
@@ -72,7 +72,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, | |||
72 | * The JOURNAL_DATA flag can only be changed by | 72 | * The JOURNAL_DATA flag can only be changed by |
73 | * the relevant capability. | 73 | * the relevant capability. |
74 | */ | 74 | */ |
75 | if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) { | 75 | if ((jflag ^ oldflags) & (EXT4_JOURNAL_DATA_FL)) { |
76 | if (!capable(CAP_SYS_RESOURCE)) { | 76 | if (!capable(CAP_SYS_RESOURCE)) { |
77 | mutex_unlock(&inode->i_mutex); | 77 | mutex_unlock(&inode->i_mutex); |
78 | return -EPERM; | 78 | return -EPERM; |
@@ -80,44 +80,44 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, | |||
80 | } | 80 | } |
81 | 81 | ||
82 | 82 | ||
83 | handle = ext3_journal_start(inode, 1); | 83 | handle = ext4_journal_start(inode, 1); |
84 | if (IS_ERR(handle)) { | 84 | if (IS_ERR(handle)) { |
85 | mutex_unlock(&inode->i_mutex); | 85 | mutex_unlock(&inode->i_mutex); |
86 | return PTR_ERR(handle); | 86 | return PTR_ERR(handle); |
87 | } | 87 | } |
88 | if (IS_SYNC(inode)) | 88 | if (IS_SYNC(inode)) |
89 | handle->h_sync = 1; | 89 | handle->h_sync = 1; |
90 | err = ext3_reserve_inode_write(handle, inode, &iloc); | 90 | err = ext4_reserve_inode_write(handle, inode, &iloc); |
91 | if (err) | 91 | if (err) |
92 | goto flags_err; | 92 | goto flags_err; |
93 | 93 | ||
94 | flags = flags & EXT3_FL_USER_MODIFIABLE; | 94 | flags = flags & EXT4_FL_USER_MODIFIABLE; |
95 | flags |= oldflags & ~EXT3_FL_USER_MODIFIABLE; | 95 | flags |= oldflags & ~EXT4_FL_USER_MODIFIABLE; |
96 | ei->i_flags = flags; | 96 | ei->i_flags = flags; |
97 | 97 | ||
98 | ext3_set_inode_flags(inode); | 98 | ext4_set_inode_flags(inode); |
99 | inode->i_ctime = CURRENT_TIME_SEC; | 99 | inode->i_ctime = CURRENT_TIME_SEC; |
100 | 100 | ||
101 | err = ext3_mark_iloc_dirty(handle, inode, &iloc); | 101 | err = ext4_mark_iloc_dirty(handle, inode, &iloc); |
102 | flags_err: | 102 | flags_err: |
103 | ext3_journal_stop(handle); | 103 | ext4_journal_stop(handle); |
104 | if (err) { | 104 | if (err) { |
105 | mutex_unlock(&inode->i_mutex); | 105 | mutex_unlock(&inode->i_mutex); |
106 | return err; | 106 | return err; |
107 | } | 107 | } |
108 | 108 | ||
109 | if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) | 109 | if ((jflag ^ oldflags) & (EXT4_JOURNAL_DATA_FL)) |
110 | err = ext3_change_inode_journal_flag(inode, jflag); | 110 | err = ext4_change_inode_journal_flag(inode, jflag); |
111 | mutex_unlock(&inode->i_mutex); | 111 | mutex_unlock(&inode->i_mutex); |
112 | return err; | 112 | return err; |
113 | } | 113 | } |
114 | case EXT3_IOC_GETVERSION: | 114 | case EXT4_IOC_GETVERSION: |
115 | case EXT3_IOC_GETVERSION_OLD: | 115 | case EXT4_IOC_GETVERSION_OLD: |
116 | return put_user(inode->i_generation, (int __user *) arg); | 116 | return put_user(inode->i_generation, (int __user *) arg); |
117 | case EXT3_IOC_SETVERSION: | 117 | case EXT4_IOC_SETVERSION: |
118 | case EXT3_IOC_SETVERSION_OLD: { | 118 | case EXT4_IOC_SETVERSION_OLD: { |
119 | handle_t *handle; | 119 | handle_t *handle; |
120 | struct ext3_iloc iloc; | 120 | struct ext4_iloc iloc; |
121 | __u32 generation; | 121 | __u32 generation; |
122 | int err; | 122 | int err; |
123 | 123 | ||
@@ -128,20 +128,20 @@ flags_err: | |||
128 | if (get_user(generation, (int __user *) arg)) | 128 | if (get_user(generation, (int __user *) arg)) |
129 | return -EFAULT; | 129 | return -EFAULT; |
130 | 130 | ||
131 | handle = ext3_journal_start(inode, 1); | 131 | handle = ext4_journal_start(inode, 1); |
132 | if (IS_ERR(handle)) | 132 | if (IS_ERR(handle)) |
133 | return PTR_ERR(handle); | 133 | return PTR_ERR(handle); |
134 | err = ext3_reserve_inode_write(handle, inode, &iloc); | 134 | err = ext4_reserve_inode_write(handle, inode, &iloc); |
135 | if (err == 0) { | 135 | if (err == 0) { |
136 | inode->i_ctime = CURRENT_TIME_SEC; | 136 | inode->i_ctime = CURRENT_TIME_SEC; |
137 | inode->i_generation = generation; | 137 | inode->i_generation = generation; |
138 | err = ext3_mark_iloc_dirty(handle, inode, &iloc); | 138 | err = ext4_mark_iloc_dirty(handle, inode, &iloc); |
139 | } | 139 | } |
140 | ext3_journal_stop(handle); | 140 | ext4_journal_stop(handle); |
141 | return err; | 141 | return err; |
142 | } | 142 | } |
143 | #ifdef CONFIG_JBD_DEBUG | 143 | #ifdef CONFIG_JBD_DEBUG |
144 | case EXT3_IOC_WAIT_FOR_READONLY: | 144 | case EXT4_IOC_WAIT_FOR_READONLY: |
145 | /* | 145 | /* |
146 | * This is racy - by the time we're woken up and running, | 146 | * This is racy - by the time we're woken up and running, |
147 | * the superblock could be released. And the module could | 147 | * the superblock could be released. And the module could |
@@ -155,16 +155,16 @@ flags_err: | |||
155 | int ret = 0; | 155 | int ret = 0; |
156 | 156 | ||
157 | set_current_state(TASK_INTERRUPTIBLE); | 157 | set_current_state(TASK_INTERRUPTIBLE); |
158 | add_wait_queue(&EXT3_SB(sb)->ro_wait_queue, &wait); | 158 | add_wait_queue(&EXT4_SB(sb)->ro_wait_queue, &wait); |
159 | if (timer_pending(&EXT3_SB(sb)->turn_ro_timer)) { | 159 | if (timer_pending(&EXT4_SB(sb)->turn_ro_timer)) { |
160 | schedule(); | 160 | schedule(); |
161 | ret = 1; | 161 | ret = 1; |
162 | } | 162 | } |
163 | remove_wait_queue(&EXT3_SB(sb)->ro_wait_queue, &wait); | 163 | remove_wait_queue(&EXT4_SB(sb)->ro_wait_queue, &wait); |
164 | return ret; | 164 | return ret; |
165 | } | 165 | } |
166 | #endif | 166 | #endif |
167 | case EXT3_IOC_GETRSVSZ: | 167 | case EXT4_IOC_GETRSVSZ: |
168 | if (test_opt(inode->i_sb, RESERVATION) | 168 | if (test_opt(inode->i_sb, RESERVATION) |
169 | && S_ISREG(inode->i_mode) | 169 | && S_ISREG(inode->i_mode) |
170 | && ei->i_block_alloc_info) { | 170 | && ei->i_block_alloc_info) { |
@@ -172,7 +172,7 @@ flags_err: | |||
172 | return put_user(rsv_window_size, (int __user *)arg); | 172 | return put_user(rsv_window_size, (int __user *)arg); |
173 | } | 173 | } |
174 | return -ENOTTY; | 174 | return -ENOTTY; |
175 | case EXT3_IOC_SETRSVSZ: { | 175 | case EXT4_IOC_SETRSVSZ: { |
176 | 176 | ||
177 | if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode)) | 177 | if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode)) |
178 | return -ENOTTY; | 178 | return -ENOTTY; |
@@ -186,8 +186,8 @@ flags_err: | |||
186 | if (get_user(rsv_window_size, (int __user *)arg)) | 186 | if (get_user(rsv_window_size, (int __user *)arg)) |
187 | return -EFAULT; | 187 | return -EFAULT; |
188 | 188 | ||
189 | if (rsv_window_size > EXT3_MAX_RESERVE_BLOCKS) | 189 | if (rsv_window_size > EXT4_MAX_RESERVE_BLOCKS) |
190 | rsv_window_size = EXT3_MAX_RESERVE_BLOCKS; | 190 | rsv_window_size = EXT4_MAX_RESERVE_BLOCKS; |
191 | 191 | ||
192 | /* | 192 | /* |
193 | * need to allocate reservation structure for this inode | 193 | * need to allocate reservation structure for this inode |
@@ -195,17 +195,17 @@ flags_err: | |||
195 | */ | 195 | */ |
196 | mutex_lock(&ei->truncate_mutex); | 196 | mutex_lock(&ei->truncate_mutex); |
197 | if (!ei->i_block_alloc_info) | 197 | if (!ei->i_block_alloc_info) |
198 | ext3_init_block_alloc_info(inode); | 198 | ext4_init_block_alloc_info(inode); |
199 | 199 | ||
200 | if (ei->i_block_alloc_info){ | 200 | if (ei->i_block_alloc_info){ |
201 | struct ext3_reserve_window_node *rsv = &ei->i_block_alloc_info->rsv_window_node; | 201 | struct ext4_reserve_window_node *rsv = &ei->i_block_alloc_info->rsv_window_node; |
202 | rsv->rsv_goal_size = rsv_window_size; | 202 | rsv->rsv_goal_size = rsv_window_size; |
203 | } | 203 | } |
204 | mutex_unlock(&ei->truncate_mutex); | 204 | mutex_unlock(&ei->truncate_mutex); |
205 | return 0; | 205 | return 0; |
206 | } | 206 | } |
207 | case EXT3_IOC_GROUP_EXTEND: { | 207 | case EXT4_IOC_GROUP_EXTEND: { |
208 | ext3_fsblk_t n_blocks_count; | 208 | ext4_fsblk_t n_blocks_count; |
209 | struct super_block *sb = inode->i_sb; | 209 | struct super_block *sb = inode->i_sb; |
210 | int err; | 210 | int err; |
211 | 211 | ||
@@ -218,15 +218,15 @@ flags_err: | |||
218 | if (get_user(n_blocks_count, (__u32 __user *)arg)) | 218 | if (get_user(n_blocks_count, (__u32 __user *)arg)) |
219 | return -EFAULT; | 219 | return -EFAULT; |
220 | 220 | ||
221 | err = ext3_group_extend(sb, EXT3_SB(sb)->s_es, n_blocks_count); | 221 | err = ext4_group_extend(sb, EXT4_SB(sb)->s_es, n_blocks_count); |
222 | journal_lock_updates(EXT3_SB(sb)->s_journal); | 222 | journal_lock_updates(EXT4_SB(sb)->s_journal); |
223 | journal_flush(EXT3_SB(sb)->s_journal); | 223 | journal_flush(EXT4_SB(sb)->s_journal); |
224 | journal_unlock_updates(EXT3_SB(sb)->s_journal); | 224 | journal_unlock_updates(EXT4_SB(sb)->s_journal); |
225 | 225 | ||
226 | return err; | 226 | return err; |
227 | } | 227 | } |
228 | case EXT3_IOC_GROUP_ADD: { | 228 | case EXT4_IOC_GROUP_ADD: { |
229 | struct ext3_new_group_data input; | 229 | struct ext4_new_group_data input; |
230 | struct super_block *sb = inode->i_sb; | 230 | struct super_block *sb = inode->i_sb; |
231 | int err; | 231 | int err; |
232 | 232 | ||
@@ -236,14 +236,14 @@ flags_err: | |||
236 | if (IS_RDONLY(inode)) | 236 | if (IS_RDONLY(inode)) |
237 | return -EROFS; | 237 | return -EROFS; |
238 | 238 | ||
239 | if (copy_from_user(&input, (struct ext3_new_group_input __user *)arg, | 239 | if (copy_from_user(&input, (struct ext4_new_group_input __user *)arg, |
240 | sizeof(input))) | 240 | sizeof(input))) |
241 | return -EFAULT; | 241 | return -EFAULT; |
242 | 242 | ||
243 | err = ext3_group_add(sb, &input); | 243 | err = ext4_group_add(sb, &input); |
244 | journal_lock_updates(EXT3_SB(sb)->s_journal); | 244 | journal_lock_updates(EXT4_SB(sb)->s_journal); |
245 | journal_flush(EXT3_SB(sb)->s_journal); | 245 | journal_flush(EXT4_SB(sb)->s_journal); |
246 | journal_unlock_updates(EXT3_SB(sb)->s_journal); | 246 | journal_unlock_updates(EXT4_SB(sb)->s_journal); |
247 | 247 | ||
248 | return err; | 248 | return err; |
249 | } | 249 | } |
@@ -255,52 +255,52 @@ flags_err: | |||
255 | } | 255 | } |
256 | 256 | ||
257 | #ifdef CONFIG_COMPAT | 257 | #ifdef CONFIG_COMPAT |
258 | long ext3_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 258 | long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
259 | { | 259 | { |
260 | struct inode *inode = file->f_dentry->d_inode; | 260 | struct inode *inode = file->f_dentry->d_inode; |
261 | int ret; | 261 | int ret; |
262 | 262 | ||
263 | /* These are just misnamed, they actually get/put from/to user an int */ | 263 | /* These are just misnamed, they actually get/put from/to user an int */ |
264 | switch (cmd) { | 264 | switch (cmd) { |
265 | case EXT3_IOC32_GETFLAGS: | 265 | case EXT4_IOC32_GETFLAGS: |
266 | cmd = EXT3_IOC_GETFLAGS; | 266 | cmd = EXT4_IOC_GETFLAGS; |
267 | break; | 267 | break; |
268 | case EXT3_IOC32_SETFLAGS: | 268 | case EXT4_IOC32_SETFLAGS: |
269 | cmd = EXT3_IOC_SETFLAGS; | 269 | cmd = EXT4_IOC_SETFLAGS; |
270 | break; | 270 | break; |
271 | case EXT3_IOC32_GETVERSION: | 271 | case EXT4_IOC32_GETVERSION: |
272 | cmd = EXT3_IOC_GETVERSION; | 272 | cmd = EXT4_IOC_GETVERSION; |
273 | break; | 273 | break; |
274 | case EXT3_IOC32_SETVERSION: | 274 | case EXT4_IOC32_SETVERSION: |
275 | cmd = EXT3_IOC_SETVERSION; | 275 | cmd = EXT4_IOC_SETVERSION; |
276 | break; | 276 | break; |
277 | case EXT3_IOC32_GROUP_EXTEND: | 277 | case EXT4_IOC32_GROUP_EXTEND: |
278 | cmd = EXT3_IOC_GROUP_EXTEND; | 278 | cmd = EXT4_IOC_GROUP_EXTEND; |
279 | break; | 279 | break; |
280 | case EXT3_IOC32_GETVERSION_OLD: | 280 | case EXT4_IOC32_GETVERSION_OLD: |
281 | cmd = EXT3_IOC_GETVERSION_OLD; | 281 | cmd = EXT4_IOC_GETVERSION_OLD; |
282 | break; | 282 | break; |
283 | case EXT3_IOC32_SETVERSION_OLD: | 283 | case EXT4_IOC32_SETVERSION_OLD: |
284 | cmd = EXT3_IOC_SETVERSION_OLD; | 284 | cmd = EXT4_IOC_SETVERSION_OLD; |
285 | break; | 285 | break; |
286 | #ifdef CONFIG_JBD_DEBUG | 286 | #ifdef CONFIG_JBD_DEBUG |
287 | case EXT3_IOC32_WAIT_FOR_READONLY: | 287 | case EXT4_IOC32_WAIT_FOR_READONLY: |
288 | cmd = EXT3_IOC_WAIT_FOR_READONLY; | 288 | cmd = EXT4_IOC_WAIT_FOR_READONLY; |
289 | break; | 289 | break; |
290 | #endif | 290 | #endif |
291 | case EXT3_IOC32_GETRSVSZ: | 291 | case EXT4_IOC32_GETRSVSZ: |
292 | cmd = EXT3_IOC_GETRSVSZ; | 292 | cmd = EXT4_IOC_GETRSVSZ; |
293 | break; | 293 | break; |
294 | case EXT3_IOC32_SETRSVSZ: | 294 | case EXT4_IOC32_SETRSVSZ: |
295 | cmd = EXT3_IOC_SETRSVSZ; | 295 | cmd = EXT4_IOC_SETRSVSZ; |
296 | break; | 296 | break; |
297 | case EXT3_IOC_GROUP_ADD: | 297 | case EXT4_IOC_GROUP_ADD: |
298 | break; | 298 | break; |
299 | default: | 299 | default: |
300 | return -ENOIOCTLCMD; | 300 | return -ENOIOCTLCMD; |
301 | } | 301 | } |
302 | lock_kernel(); | 302 | lock_kernel(); |
303 | ret = ext3_ioctl(inode, file, cmd, (unsigned long) compat_ptr(arg)); | 303 | ret = ext4_ioctl(inode, file, cmd, (unsigned long) compat_ptr(arg)); |
304 | unlock_kernel(); | 304 | unlock_kernel(); |
305 | return ret; | 305 | return ret; |
306 | } | 306 | } |