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