Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/fs/ext3/ioctl.c |
| 3 | * |
| 4 | * Copyright (C) 1993, 1994, 1995 |
| 5 | * Remy Card (card@masi.ibp.fr) |
| 6 | * Laboratoire MASI - Institut Blaise Pascal |
| 7 | * Universite Pierre et Marie Curie (Paris VI) |
| 8 | */ |
| 9 | |
| 10 | #include <linux/fs.h> |
| 11 | #include <linux/jbd.h> |
Randy Dunlap | 16f7e0f | 2006-01-11 12:17:46 -0800 | [diff] [blame] | 12 | #include <linux/capability.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #include <linux/ext3_fs.h> |
| 14 | #include <linux/ext3_jbd.h> |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 15 | #include <linux/mount.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include <linux/time.h> |
David Howells | 52a700c | 2006-08-29 19:06:23 +0100 | [diff] [blame] | 17 | #include <linux/compat.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #include <asm/uaccess.h> |
| 19 | |
Cyrus Massoumi | 039fd8c | 2009-04-02 16:57:12 -0700 | [diff] [blame] | 20 | long ext3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | { |
Cyrus Massoumi | 039fd8c | 2009-04-02 16:57:12 -0700 | [diff] [blame] | 22 | struct inode *inode = filp->f_dentry->d_inode; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | struct ext3_inode_info *ei = EXT3_I(inode); |
| 24 | unsigned int flags; |
| 25 | unsigned short rsv_window_size; |
| 26 | |
| 27 | ext3_debug ("cmd = %u, arg = %lu\n", cmd, arg); |
| 28 | |
| 29 | switch (cmd) { |
| 30 | case EXT3_IOC_GETFLAGS: |
Jan Kara | 28be5ab | 2007-05-08 00:30:33 -0700 | [diff] [blame] | 31 | ext3_get_inode_flags(ei); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | flags = ei->i_flags & EXT3_FL_USER_VISIBLE; |
| 33 | return put_user(flags, (int __user *) arg); |
| 34 | case EXT3_IOC_SETFLAGS: { |
| 35 | handle_t *handle = NULL; |
| 36 | int err; |
| 37 | struct ext3_iloc iloc; |
| 38 | unsigned int oldflags; |
| 39 | unsigned int jflag; |
| 40 | |
Serge E. Hallyn | 2e14967 | 2011-03-23 16:43:26 -0700 | [diff] [blame] | 41 | if (!inode_owner_or_capable(inode)) |
Cyrus Massoumi | 039fd8c | 2009-04-02 16:57:12 -0700 | [diff] [blame] | 42 | return -EACCES; |
| 43 | |
| 44 | if (get_user(flags, (int __user *) arg)) |
| 45 | return -EFAULT; |
| 46 | |
Al Viro | a561be7 | 2011-11-23 11:57:51 -0500 | [diff] [blame^] | 47 | err = mnt_want_write_file(filp); |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 48 | if (err) |
| 49 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | |
Duane Griffin | 04143e2 | 2009-01-07 18:07:26 -0800 | [diff] [blame] | 51 | flags = ext3_mask_flags(inode->i_mode, flags); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | |
Al Viro | a090d91 | 2006-04-26 07:32:40 +0100 | [diff] [blame] | 53 | mutex_lock(&inode->i_mutex); |
Cyrus Massoumi | 039fd8c | 2009-04-02 16:57:12 -0700 | [diff] [blame] | 54 | |
Jan Kara | e47776a | 2007-11-14 16:58:56 -0800 | [diff] [blame] | 55 | /* Is it quota file? Do not allow user to mess with it */ |
Cyrus Massoumi | 039fd8c | 2009-04-02 16:57:12 -0700 | [diff] [blame] | 56 | err = -EPERM; |
| 57 | if (IS_NOQUOTA(inode)) |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 58 | goto flags_out; |
Cyrus Massoumi | 039fd8c | 2009-04-02 16:57:12 -0700 | [diff] [blame] | 59 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | oldflags = ei->i_flags; |
| 61 | |
| 62 | /* The JOURNAL_DATA flag is modifiable only by root */ |
| 63 | jflag = flags & EXT3_JOURNAL_DATA_FL; |
| 64 | |
| 65 | /* |
| 66 | * The IMMUTABLE and APPEND_ONLY flags can only be changed by |
| 67 | * the relevant capability. |
| 68 | * |
| 69 | * This test looks nicer. Thanks to Pauline Middelink |
| 70 | */ |
| 71 | if ((flags ^ oldflags) & (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL)) { |
Cyrus Massoumi | 039fd8c | 2009-04-02 16:57:12 -0700 | [diff] [blame] | 72 | if (!capable(CAP_LINUX_IMMUTABLE)) |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 73 | goto flags_out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | /* |
| 77 | * The JOURNAL_DATA flag can only be changed by |
| 78 | * the relevant capability. |
| 79 | */ |
| 80 | if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) { |
Cyrus Massoumi | 039fd8c | 2009-04-02 16:57:12 -0700 | [diff] [blame] | 81 | if (!capable(CAP_SYS_RESOURCE)) |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 82 | goto flags_out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | } |
| 84 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 | handle = ext3_journal_start(inode, 1); |
Al Viro | a090d91 | 2006-04-26 07:32:40 +0100 | [diff] [blame] | 86 | if (IS_ERR(handle)) { |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 87 | err = PTR_ERR(handle); |
| 88 | goto flags_out; |
Al Viro | a090d91 | 2006-04-26 07:32:40 +0100 | [diff] [blame] | 89 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | if (IS_SYNC(inode)) |
| 91 | handle->h_sync = 1; |
| 92 | err = ext3_reserve_inode_write(handle, inode, &iloc); |
| 93 | if (err) |
| 94 | goto flags_err; |
| 95 | |
| 96 | flags = flags & EXT3_FL_USER_MODIFIABLE; |
| 97 | flags |= oldflags & ~EXT3_FL_USER_MODIFIABLE; |
| 98 | ei->i_flags = flags; |
| 99 | |
| 100 | ext3_set_inode_flags(inode); |
| 101 | inode->i_ctime = CURRENT_TIME_SEC; |
| 102 | |
| 103 | err = ext3_mark_iloc_dirty(handle, inode, &iloc); |
| 104 | flags_err: |
| 105 | ext3_journal_stop(handle); |
Cyrus Massoumi | 039fd8c | 2009-04-02 16:57:12 -0700 | [diff] [blame] | 106 | if (err) |
| 107 | goto flags_out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | |
| 109 | if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) |
| 110 | err = ext3_change_inode_journal_flag(inode, jflag); |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 111 | flags_out: |
Cyrus Massoumi | 039fd8c | 2009-04-02 16:57:12 -0700 | [diff] [blame] | 112 | mutex_unlock(&inode->i_mutex); |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 113 | mnt_drop_write(filp->f_path.mnt); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | return err; |
| 115 | } |
| 116 | case EXT3_IOC_GETVERSION: |
| 117 | case EXT3_IOC_GETVERSION_OLD: |
| 118 | return put_user(inode->i_generation, (int __user *) arg); |
| 119 | case EXT3_IOC_SETVERSION: |
| 120 | case EXT3_IOC_SETVERSION_OLD: { |
| 121 | handle_t *handle; |
| 122 | struct ext3_iloc iloc; |
| 123 | __u32 generation; |
| 124 | int err; |
| 125 | |
Serge E. Hallyn | 2e14967 | 2011-03-23 16:43:26 -0700 | [diff] [blame] | 126 | if (!inode_owner_or_capable(inode)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | return -EPERM; |
Cyrus Massoumi | 039fd8c | 2009-04-02 16:57:12 -0700 | [diff] [blame] | 128 | |
Al Viro | a561be7 | 2011-11-23 11:57:51 -0500 | [diff] [blame^] | 129 | err = mnt_want_write_file(filp); |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 130 | if (err) |
| 131 | return err; |
| 132 | if (get_user(generation, (int __user *) arg)) { |
| 133 | err = -EFAULT; |
| 134 | goto setversion_out; |
| 135 | } |
Cyrus Massoumi | 039fd8c | 2009-04-02 16:57:12 -0700 | [diff] [blame] | 136 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 137 | handle = ext3_journal_start(inode, 1); |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 138 | if (IS_ERR(handle)) { |
| 139 | err = PTR_ERR(handle); |
| 140 | goto setversion_out; |
| 141 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 142 | err = ext3_reserve_inode_write(handle, inode, &iloc); |
| 143 | if (err == 0) { |
| 144 | inode->i_ctime = CURRENT_TIME_SEC; |
| 145 | inode->i_generation = generation; |
| 146 | err = ext3_mark_iloc_dirty(handle, inode, &iloc); |
| 147 | } |
| 148 | ext3_journal_stop(handle); |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 149 | setversion_out: |
| 150 | mnt_drop_write(filp->f_path.mnt); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | return err; |
| 152 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 153 | case EXT3_IOC_GETRSVSZ: |
| 154 | if (test_opt(inode->i_sb, RESERVATION) |
| 155 | && S_ISREG(inode->i_mode) |
| 156 | && ei->i_block_alloc_info) { |
| 157 | rsv_window_size = ei->i_block_alloc_info->rsv_window_node.rsv_goal_size; |
| 158 | return put_user(rsv_window_size, (int __user *)arg); |
| 159 | } |
| 160 | return -ENOTTY; |
| 161 | case EXT3_IOC_SETRSVSZ: { |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 162 | int err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | |
| 164 | if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode)) |
| 165 | return -ENOTTY; |
| 166 | |
Al Viro | a561be7 | 2011-11-23 11:57:51 -0500 | [diff] [blame^] | 167 | err = mnt_want_write_file(filp); |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 168 | if (err) |
| 169 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | |
Serge E. Hallyn | 2e14967 | 2011-03-23 16:43:26 -0700 | [diff] [blame] | 171 | if (!inode_owner_or_capable(inode)) { |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 172 | err = -EACCES; |
| 173 | goto setrsvsz_out; |
| 174 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 175 | |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 176 | if (get_user(rsv_window_size, (int __user *)arg)) { |
| 177 | err = -EFAULT; |
| 178 | goto setrsvsz_out; |
| 179 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | |
| 181 | if (rsv_window_size > EXT3_MAX_RESERVE_BLOCKS) |
| 182 | rsv_window_size = EXT3_MAX_RESERVE_BLOCKS; |
| 183 | |
| 184 | /* |
| 185 | * need to allocate reservation structure for this inode |
| 186 | * before set the window size |
| 187 | */ |
Arjan van de Ven | 9746151 | 2006-03-23 03:00:42 -0800 | [diff] [blame] | 188 | mutex_lock(&ei->truncate_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 189 | if (!ei->i_block_alloc_info) |
| 190 | ext3_init_block_alloc_info(inode); |
| 191 | |
| 192 | if (ei->i_block_alloc_info){ |
| 193 | struct ext3_reserve_window_node *rsv = &ei->i_block_alloc_info->rsv_window_node; |
| 194 | rsv->rsv_goal_size = rsv_window_size; |
| 195 | } |
Arjan van de Ven | 9746151 | 2006-03-23 03:00:42 -0800 | [diff] [blame] | 196 | mutex_unlock(&ei->truncate_mutex); |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 197 | setrsvsz_out: |
| 198 | mnt_drop_write(filp->f_path.mnt); |
| 199 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 200 | } |
| 201 | case EXT3_IOC_GROUP_EXTEND: { |
Mingming Cao | 43d23f9 | 2006-06-25 05:48:07 -0700 | [diff] [blame] | 202 | ext3_fsblk_t n_blocks_count; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 203 | struct super_block *sb = inode->i_sb; |
Hidehiro Kawai | 2d7c820 | 2008-10-22 14:15:01 -0700 | [diff] [blame] | 204 | int err, err2; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 205 | |
| 206 | if (!capable(CAP_SYS_RESOURCE)) |
| 207 | return -EPERM; |
| 208 | |
Al Viro | a561be7 | 2011-11-23 11:57:51 -0500 | [diff] [blame^] | 209 | err = mnt_want_write_file(filp); |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 210 | if (err) |
| 211 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 | |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 213 | if (get_user(n_blocks_count, (__u32 __user *)arg)) { |
| 214 | err = -EFAULT; |
| 215 | goto group_extend_out; |
| 216 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | err = ext3_group_extend(sb, EXT3_SB(sb)->s_es, n_blocks_count); |
| 218 | journal_lock_updates(EXT3_SB(sb)->s_journal); |
Hidehiro Kawai | 2d7c820 | 2008-10-22 14:15:01 -0700 | [diff] [blame] | 219 | err2 = journal_flush(EXT3_SB(sb)->s_journal); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | journal_unlock_updates(EXT3_SB(sb)->s_journal); |
Hidehiro Kawai | 2d7c820 | 2008-10-22 14:15:01 -0700 | [diff] [blame] | 221 | if (err == 0) |
| 222 | err = err2; |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 223 | group_extend_out: |
| 224 | mnt_drop_write(filp->f_path.mnt); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | return err; |
| 226 | } |
| 227 | case EXT3_IOC_GROUP_ADD: { |
| 228 | struct ext3_new_group_data input; |
| 229 | struct super_block *sb = inode->i_sb; |
Hidehiro Kawai | 2d7c820 | 2008-10-22 14:15:01 -0700 | [diff] [blame] | 230 | int err, err2; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | |
| 232 | if (!capable(CAP_SYS_RESOURCE)) |
| 233 | return -EPERM; |
| 234 | |
Al Viro | a561be7 | 2011-11-23 11:57:51 -0500 | [diff] [blame^] | 235 | err = mnt_want_write_file(filp); |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 236 | if (err) |
| 237 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 238 | |
| 239 | if (copy_from_user(&input, (struct ext3_new_group_input __user *)arg, |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 240 | sizeof(input))) { |
| 241 | err = -EFAULT; |
| 242 | goto group_add_out; |
| 243 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | |
| 245 | err = ext3_group_add(sb, &input); |
| 246 | journal_lock_updates(EXT3_SB(sb)->s_journal); |
Hidehiro Kawai | 2d7c820 | 2008-10-22 14:15:01 -0700 | [diff] [blame] | 247 | err2 = journal_flush(EXT3_SB(sb)->s_journal); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | journal_unlock_updates(EXT3_SB(sb)->s_journal); |
Hidehiro Kawai | 2d7c820 | 2008-10-22 14:15:01 -0700 | [diff] [blame] | 249 | if (err == 0) |
| 250 | err = err2; |
Dave Hansen | 42a74f2 | 2008-02-15 14:37:46 -0800 | [diff] [blame] | 251 | group_add_out: |
| 252 | mnt_drop_write(filp->f_path.mnt); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | return err; |
| 254 | } |
Lukas Czerner | 9c52749 | 2010-11-22 12:29:18 +0100 | [diff] [blame] | 255 | case FITRIM: { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | |
Lukas Czerner | 9c52749 | 2010-11-22 12:29:18 +0100 | [diff] [blame] | 257 | struct super_block *sb = inode->i_sb; |
| 258 | struct fstrim_range range; |
| 259 | int ret = 0; |
| 260 | |
| 261 | if (!capable(CAP_SYS_ADMIN)) |
| 262 | return -EPERM; |
| 263 | |
H Hartley Sweeten | 81fe8c6 | 2011-06-10 14:59:05 -0700 | [diff] [blame] | 264 | if (copy_from_user(&range, (struct fstrim_range __user *)arg, |
Lukas Czerner | 9c52749 | 2010-11-22 12:29:18 +0100 | [diff] [blame] | 265 | sizeof(range))) |
| 266 | return -EFAULT; |
| 267 | |
| 268 | ret = ext3_trim_fs(sb, &range); |
| 269 | if (ret < 0) |
| 270 | return ret; |
| 271 | |
H Hartley Sweeten | 81fe8c6 | 2011-06-10 14:59:05 -0700 | [diff] [blame] | 272 | if (copy_to_user((struct fstrim_range __user *)arg, &range, |
Lukas Czerner | 9c52749 | 2010-11-22 12:29:18 +0100 | [diff] [blame] | 273 | sizeof(range))) |
| 274 | return -EFAULT; |
| 275 | |
| 276 | return 0; |
| 277 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 278 | |
| 279 | default: |
| 280 | return -ENOTTY; |
| 281 | } |
| 282 | } |
David Howells | 52a700c | 2006-08-29 19:06:23 +0100 | [diff] [blame] | 283 | |
| 284 | #ifdef CONFIG_COMPAT |
| 285 | long ext3_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
| 286 | { |
David Howells | 52a700c | 2006-08-29 19:06:23 +0100 | [diff] [blame] | 287 | /* These are just misnamed, they actually get/put from/to user an int */ |
| 288 | switch (cmd) { |
| 289 | case EXT3_IOC32_GETFLAGS: |
| 290 | cmd = EXT3_IOC_GETFLAGS; |
| 291 | break; |
| 292 | case EXT3_IOC32_SETFLAGS: |
| 293 | cmd = EXT3_IOC_SETFLAGS; |
| 294 | break; |
| 295 | case EXT3_IOC32_GETVERSION: |
| 296 | cmd = EXT3_IOC_GETVERSION; |
| 297 | break; |
| 298 | case EXT3_IOC32_SETVERSION: |
| 299 | cmd = EXT3_IOC_SETVERSION; |
| 300 | break; |
| 301 | case EXT3_IOC32_GROUP_EXTEND: |
| 302 | cmd = EXT3_IOC_GROUP_EXTEND; |
| 303 | break; |
| 304 | case EXT3_IOC32_GETVERSION_OLD: |
| 305 | cmd = EXT3_IOC_GETVERSION_OLD; |
| 306 | break; |
| 307 | case EXT3_IOC32_SETVERSION_OLD: |
| 308 | cmd = EXT3_IOC_SETVERSION_OLD; |
| 309 | break; |
| 310 | #ifdef CONFIG_JBD_DEBUG |
| 311 | case EXT3_IOC32_WAIT_FOR_READONLY: |
| 312 | cmd = EXT3_IOC_WAIT_FOR_READONLY; |
| 313 | break; |
| 314 | #endif |
| 315 | case EXT3_IOC32_GETRSVSZ: |
| 316 | cmd = EXT3_IOC_GETRSVSZ; |
| 317 | break; |
| 318 | case EXT3_IOC32_SETRSVSZ: |
| 319 | cmd = EXT3_IOC_SETRSVSZ; |
| 320 | break; |
| 321 | case EXT3_IOC_GROUP_ADD: |
| 322 | break; |
| 323 | default: |
| 324 | return -ENOIOCTLCMD; |
| 325 | } |
Cyrus Massoumi | 039fd8c | 2009-04-02 16:57:12 -0700 | [diff] [blame] | 326 | return ext3_ioctl(file, cmd, (unsigned long) compat_ptr(arg)); |
David Howells | 52a700c | 2006-08-29 19:06:23 +0100 | [diff] [blame] | 327 | } |
| 328 | #endif |