]>
Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
7b718769 NS |
2 | * Copyright (c) 2004-2005 Silicon Graphics, Inc. |
3 | * All Rights Reserved. | |
1da177e4 | 4 | * |
7b718769 NS |
5 | * This program is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU General Public License as | |
1da177e4 LT |
7 | * published by the Free Software Foundation. |
8 | * | |
7b718769 NS |
9 | * This program is distributed in the hope that it would be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
1da177e4 | 13 | * |
7b718769 NS |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write the Free Software Foundation, | |
16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
1da177e4 | 17 | */ |
1da177e4 LT |
18 | #include <linux/compat.h> |
19 | #include <linux/init.h> | |
20 | #include <linux/ioctl.h> | |
1da177e4 LT |
21 | #include <linux/syscalls.h> |
22 | #include <linux/types.h> | |
23 | #include <linux/fs.h> | |
24 | #include <asm/uaccess.h> | |
1da177e4 | 25 | #include "xfs.h" |
1da177e4 | 26 | #include "xfs_fs.h" |
faa63e95 MM |
27 | #include "xfs_bit.h" |
28 | #include "xfs_log.h" | |
29 | #include "xfs_inum.h" | |
30 | #include "xfs_trans.h" | |
31 | #include "xfs_sb.h" | |
32 | #include "xfs_ag.h" | |
33 | #include "xfs_dir2.h" | |
34 | #include "xfs_dmapi.h" | |
35 | #include "xfs_mount.h" | |
36 | #include "xfs_bmap_btree.h" | |
37 | #include "xfs_attr_sf.h" | |
38 | #include "xfs_dir2_sf.h" | |
1da177e4 LT |
39 | #include "xfs_vfs.h" |
40 | #include "xfs_vnode.h" | |
faa63e95 MM |
41 | #include "xfs_dinode.h" |
42 | #include "xfs_inode.h" | |
43 | #include "xfs_itable.h" | |
44 | #include "xfs_error.h" | |
1da177e4 LT |
45 | #include "xfs_dfrag.h" |
46 | ||
526c420c ES |
47 | #define _NATIVE_IOC(cmd, type) \ |
48 | _IOC(_IOC_DIR(cmd), _IOC_TYPE(cmd), _IOC_NR(cmd), sizeof(type)) | |
49 | ||
1da177e4 LT |
50 | #if defined(CONFIG_IA64) || defined(CONFIG_X86_64) |
51 | #define BROKEN_X86_ALIGNMENT | |
faa63e95 | 52 | #define _PACKED __attribute__((packed)) |
526c420c ES |
53 | /* on ia32 l_start is on a 32-bit boundary */ |
54 | typedef struct xfs_flock64_32 { | |
55 | __s16 l_type; | |
56 | __s16 l_whence; | |
57 | __s64 l_start __attribute__((packed)); | |
58 | /* len == 0 means until end of file */ | |
59 | __s64 l_len __attribute__((packed)); | |
60 | __s32 l_sysid; | |
61 | __u32 l_pid; | |
62 | __s32 l_pad[4]; /* reserve area */ | |
63 | } xfs_flock64_32_t; | |
64 | ||
65 | #define XFS_IOC_ALLOCSP_32 _IOW ('X', 10, struct xfs_flock64_32) | |
66 | #define XFS_IOC_FREESP_32 _IOW ('X', 11, struct xfs_flock64_32) | |
67 | #define XFS_IOC_ALLOCSP64_32 _IOW ('X', 36, struct xfs_flock64_32) | |
68 | #define XFS_IOC_FREESP64_32 _IOW ('X', 37, struct xfs_flock64_32) | |
69 | #define XFS_IOC_RESVSP_32 _IOW ('X', 40, struct xfs_flock64_32) | |
70 | #define XFS_IOC_UNRESVSP_32 _IOW ('X', 41, struct xfs_flock64_32) | |
71 | #define XFS_IOC_RESVSP64_32 _IOW ('X', 42, struct xfs_flock64_32) | |
72 | #define XFS_IOC_UNRESVSP64_32 _IOW ('X', 43, struct xfs_flock64_32) | |
73 | ||
74 | /* just account for different alignment */ | |
75 | STATIC unsigned long | |
76 | xfs_ioctl32_flock( | |
77 | unsigned long arg) | |
78 | { | |
79 | xfs_flock64_32_t __user *p32 = (void __user *)arg; | |
80 | xfs_flock64_t __user *p = compat_alloc_user_space(sizeof(*p)); | |
81 | ||
82 | if (copy_in_user(&p->l_type, &p32->l_type, sizeof(s16)) || | |
83 | copy_in_user(&p->l_whence, &p32->l_whence, sizeof(s16)) || | |
84 | copy_in_user(&p->l_start, &p32->l_start, sizeof(s64)) || | |
85 | copy_in_user(&p->l_len, &p32->l_len, sizeof(s64)) || | |
86 | copy_in_user(&p->l_sysid, &p32->l_sysid, sizeof(s32)) || | |
87 | copy_in_user(&p->l_pid, &p32->l_pid, sizeof(u32)) || | |
88 | copy_in_user(&p->l_pad, &p32->l_pad, 4*sizeof(u32))) | |
89 | return -EFAULT; | |
e0edd596 | 90 | |
526c420c ES |
91 | return (unsigned long)p; |
92 | } | |
93 | ||
547e00c3 MM |
94 | typedef struct compat_xfs_fsop_geom_v1 { |
95 | __u32 blocksize; /* filesystem (data) block size */ | |
96 | __u32 rtextsize; /* realtime extent size */ | |
97 | __u32 agblocks; /* fsblocks in an AG */ | |
98 | __u32 agcount; /* number of allocation groups */ | |
99 | __u32 logblocks; /* fsblocks in the log */ | |
100 | __u32 sectsize; /* (data) sector size, bytes */ | |
101 | __u32 inodesize; /* inode size in bytes */ | |
102 | __u32 imaxpct; /* max allowed inode space(%) */ | |
103 | __u64 datablocks; /* fsblocks in data subvolume */ | |
104 | __u64 rtblocks; /* fsblocks in realtime subvol */ | |
105 | __u64 rtextents; /* rt extents in realtime subvol*/ | |
106 | __u64 logstart; /* starting fsblock of the log */ | |
107 | unsigned char uuid[16]; /* unique id of the filesystem */ | |
108 | __u32 sunit; /* stripe unit, fsblocks */ | |
109 | __u32 swidth; /* stripe width, fsblocks */ | |
110 | __s32 version; /* structure version */ | |
111 | __u32 flags; /* superblock version flags */ | |
112 | __u32 logsectsize; /* log sector size, bytes */ | |
113 | __u32 rtsectsize; /* realtime sector size, bytes */ | |
114 | __u32 dirblocksize; /* directory block size, bytes */ | |
115 | } __attribute__((packed)) compat_xfs_fsop_geom_v1_t; | |
116 | ||
117 | #define XFS_IOC_FSGEOMETRY_V1_32 \ | |
118 | _IOR ('X', 100, struct compat_xfs_fsop_geom_v1) | |
119 | ||
120 | STATIC unsigned long xfs_ioctl32_geom_v1(unsigned long arg) | |
121 | { | |
122 | compat_xfs_fsop_geom_v1_t __user *p32 = (void __user *)arg; | |
123 | xfs_fsop_geom_v1_t __user *p = compat_alloc_user_space(sizeof(*p)); | |
124 | ||
125 | if (copy_in_user(p, p32, sizeof(*p32))) | |
126 | return -EFAULT; | |
127 | return (unsigned long)p; | |
128 | } | |
129 | ||
faa63e95 MM |
130 | typedef struct compat_xfs_inogrp { |
131 | __u64 xi_startino; /* starting inode number */ | |
132 | __s32 xi_alloccount; /* # bits set in allocmask */ | |
133 | __u64 xi_allocmask; /* mask of allocated inodes */ | |
134 | } __attribute__((packed)) compat_xfs_inogrp_t; | |
135 | ||
136 | STATIC int xfs_inumbers_fmt_compat( | |
137 | void __user *ubuffer, | |
138 | const xfs_inogrp_t *buffer, | |
139 | long count, | |
140 | long *written) | |
141 | { | |
142 | compat_xfs_inogrp_t *p32 = ubuffer; | |
143 | long i; | |
144 | ||
145 | for (i = 0; i < count; i++) { | |
146 | if (put_user(buffer[i].xi_startino, &p32[i].xi_startino) || | |
147 | put_user(buffer[i].xi_alloccount, &p32[i].xi_alloccount) || | |
148 | put_user(buffer[i].xi_allocmask, &p32[i].xi_allocmask)) | |
149 | return -EFAULT; | |
150 | } | |
151 | *written = count * sizeof(*p32); | |
152 | return 0; | |
153 | } | |
154 | ||
1da177e4 LT |
155 | #else |
156 | ||
faa63e95 MM |
157 | #define xfs_inumbers_fmt_compat xfs_inumbers_fmt |
158 | #define _PACKED | |
159 | ||
160 | #endif | |
161 | ||
162 | /* XFS_IOC_FSBULKSTAT and friends */ | |
163 | ||
164 | typedef struct compat_xfs_bstime { | |
165 | __s32 tv_sec; /* seconds */ | |
166 | __s32 tv_nsec; /* and nanoseconds */ | |
167 | } compat_xfs_bstime_t; | |
168 | ||
169 | STATIC int xfs_bstime_store_compat( | |
170 | compat_xfs_bstime_t __user *p32, | |
171 | const xfs_bstime_t *p) | |
172 | { | |
173 | __s32 sec32; | |
174 | ||
175 | sec32 = p->tv_sec; | |
176 | if (put_user(sec32, &p32->tv_sec) || | |
177 | put_user(p->tv_nsec, &p32->tv_nsec)) | |
178 | return -EFAULT; | |
179 | return 0; | |
180 | } | |
181 | ||
182 | typedef struct compat_xfs_bstat { | |
183 | __u64 bs_ino; /* inode number */ | |
184 | __u16 bs_mode; /* type and mode */ | |
185 | __u16 bs_nlink; /* number of links */ | |
186 | __u32 bs_uid; /* user id */ | |
187 | __u32 bs_gid; /* group id */ | |
188 | __u32 bs_rdev; /* device value */ | |
189 | __s32 bs_blksize; /* block size */ | |
190 | __s64 bs_size; /* file size */ | |
191 | compat_xfs_bstime_t bs_atime; /* access time */ | |
192 | compat_xfs_bstime_t bs_mtime; /* modify time */ | |
193 | compat_xfs_bstime_t bs_ctime; /* inode change time */ | |
194 | int64_t bs_blocks; /* number of blocks */ | |
195 | __u32 bs_xflags; /* extended flags */ | |
196 | __s32 bs_extsize; /* extent size */ | |
197 | __s32 bs_extents; /* number of extents */ | |
198 | __u32 bs_gen; /* generation count */ | |
199 | __u16 bs_projid; /* project id */ | |
200 | unsigned char bs_pad[14]; /* pad space, unused */ | |
201 | __u32 bs_dmevmask; /* DMIG event mask */ | |
202 | __u16 bs_dmstate; /* DMIG state info */ | |
203 | __u16 bs_aextents; /* attribute number of extents */ | |
204 | } _PACKED compat_xfs_bstat_t; | |
205 | ||
206 | STATIC int xfs_bulkstat_one_fmt_compat( | |
207 | void __user *ubuffer, | |
208 | const xfs_bstat_t *buffer) | |
209 | { | |
210 | compat_xfs_bstat_t __user *p32 = ubuffer; | |
211 | ||
212 | if (put_user(buffer->bs_ino, &p32->bs_ino) || | |
213 | put_user(buffer->bs_mode, &p32->bs_mode) || | |
214 | put_user(buffer->bs_nlink, &p32->bs_nlink) || | |
215 | put_user(buffer->bs_uid, &p32->bs_uid) || | |
216 | put_user(buffer->bs_gid, &p32->bs_gid) || | |
217 | put_user(buffer->bs_rdev, &p32->bs_rdev) || | |
218 | put_user(buffer->bs_blksize, &p32->bs_blksize) || | |
219 | put_user(buffer->bs_size, &p32->bs_size) || | |
220 | xfs_bstime_store_compat(&p32->bs_atime, &buffer->bs_atime) || | |
221 | xfs_bstime_store_compat(&p32->bs_mtime, &buffer->bs_mtime) || | |
222 | xfs_bstime_store_compat(&p32->bs_ctime, &buffer->bs_ctime) || | |
223 | put_user(buffer->bs_blocks, &p32->bs_blocks) || | |
224 | put_user(buffer->bs_xflags, &p32->bs_xflags) || | |
225 | put_user(buffer->bs_extsize, &p32->bs_extsize) || | |
226 | put_user(buffer->bs_extents, &p32->bs_extents) || | |
227 | put_user(buffer->bs_gen, &p32->bs_gen) || | |
228 | put_user(buffer->bs_projid, &p32->bs_projid) || | |
229 | put_user(buffer->bs_dmevmask, &p32->bs_dmevmask) || | |
230 | put_user(buffer->bs_dmstate, &p32->bs_dmstate) || | |
231 | put_user(buffer->bs_aextents, &p32->bs_aextents)) | |
232 | return -EFAULT; | |
233 | return sizeof(*p32); | |
234 | } | |
235 | ||
236 | ||
237 | ||
238 | typedef struct compat_xfs_fsop_bulkreq { | |
1da177e4 LT |
239 | compat_uptr_t lastip; /* last inode # pointer */ |
240 | __s32 icount; /* count of entries in buffer */ | |
241 | compat_uptr_t ubuffer; /* user buffer for inode desc. */ | |
faa63e95 MM |
242 | compat_uptr_t ocount; /* output count pointer */ |
243 | } compat_xfs_fsop_bulkreq_t; | |
1da177e4 | 244 | |
faa63e95 MM |
245 | #define XFS_IOC_FSBULKSTAT_32 \ |
246 | _IOWR('X', 101, struct compat_xfs_fsop_bulkreq) | |
247 | #define XFS_IOC_FSBULKSTAT_SINGLE_32 \ | |
248 | _IOWR('X', 102, struct compat_xfs_fsop_bulkreq) | |
249 | #define XFS_IOC_FSINUMBERS_32 \ | |
250 | _IOWR('X', 103, struct compat_xfs_fsop_bulkreq) | |
251 | ||
252 | /* copied from xfs_ioctl.c */ | |
253 | STATIC int | |
254 | xfs_ioc_bulkstat_compat( | |
255 | xfs_mount_t *mp, | |
256 | unsigned int cmd, | |
257 | void __user *arg) | |
1da177e4 | 258 | { |
faa63e95 | 259 | compat_xfs_fsop_bulkreq_t __user *p32 = (void __user *)arg; |
1da177e4 | 260 | u32 addr; |
faa63e95 MM |
261 | xfs_fsop_bulkreq_t bulkreq; |
262 | int count; /* # of records returned */ | |
263 | xfs_ino_t inlast; /* last inode number */ | |
264 | int done; | |
265 | int error; | |
266 | ||
267 | /* done = 1 if there are more stats to get and if bulkstat */ | |
268 | /* should be called again (unused here, but used in dmapi) */ | |
1da177e4 | 269 | |
faa63e95 MM |
270 | if (!capable(CAP_SYS_ADMIN)) |
271 | return -EPERM; | |
272 | ||
273 | if (XFS_FORCED_SHUTDOWN(mp)) | |
274 | return -XFS_ERROR(EIO); | |
275 | ||
276 | if (get_user(addr, &p32->lastip)) | |
277 | return -EFAULT; | |
278 | bulkreq.lastip = compat_ptr(addr); | |
279 | if (get_user(bulkreq.icount, &p32->icount) || | |
280 | get_user(addr, &p32->ubuffer)) | |
1da177e4 | 281 | return -EFAULT; |
faa63e95 MM |
282 | bulkreq.ubuffer = compat_ptr(addr); |
283 | if (get_user(addr, &p32->ocount)) | |
284 | return -EFAULT; | |
285 | bulkreq.ocount = compat_ptr(addr); | |
1da177e4 | 286 | |
faa63e95 MM |
287 | if (copy_from_user(&inlast, bulkreq.lastip, sizeof(__s64))) |
288 | return -XFS_ERROR(EFAULT); | |
289 | ||
290 | if ((count = bulkreq.icount) <= 0) | |
291 | return -XFS_ERROR(EINVAL); | |
292 | ||
293 | if (cmd == XFS_IOC_FSINUMBERS) | |
294 | error = xfs_inumbers(mp, &inlast, &count, | |
295 | bulkreq.ubuffer, xfs_inumbers_fmt_compat); | |
296 | else { | |
297 | /* declare a var to get a warning in case the type changes */ | |
298 | bulkstat_one_fmt_pf formatter = xfs_bulkstat_one_fmt_compat; | |
299 | error = xfs_bulkstat(mp, &inlast, &count, | |
300 | xfs_bulkstat_one, formatter, | |
301 | sizeof(compat_xfs_bstat_t), bulkreq.ubuffer, | |
302 | BULKSTAT_FG_QUICK, &done); | |
303 | } | |
304 | if (error) | |
305 | return -error; | |
306 | ||
307 | if (bulkreq.ocount != NULL) { | |
308 | if (copy_to_user(bulkreq.lastip, &inlast, | |
309 | sizeof(xfs_ino_t))) | |
310 | return -XFS_ERROR(EFAULT); | |
311 | ||
312 | if (copy_to_user(bulkreq.ocount, &count, sizeof(count))) | |
313 | return -XFS_ERROR(EFAULT); | |
314 | } | |
315 | ||
316 | return 0; | |
1da177e4 | 317 | } |
faa63e95 MM |
318 | |
319 | ||
1da177e4 | 320 | |
1fa503df MM |
321 | typedef struct compat_xfs_fsop_handlereq { |
322 | __u32 fd; /* fd for FD_TO_HANDLE */ | |
323 | compat_uptr_t path; /* user pathname */ | |
324 | __u32 oflags; /* open flags */ | |
325 | compat_uptr_t ihandle; /* user supplied handle */ | |
326 | __u32 ihandlen; /* user supplied length */ | |
327 | compat_uptr_t ohandle; /* user buffer for handle */ | |
328 | compat_uptr_t ohandlen; /* user buffer length */ | |
329 | } compat_xfs_fsop_handlereq_t; | |
330 | ||
331 | #define XFS_IOC_PATH_TO_FSHANDLE_32 \ | |
332 | _IOWR('X', 104, struct compat_xfs_fsop_handlereq) | |
333 | #define XFS_IOC_PATH_TO_HANDLE_32 \ | |
334 | _IOWR('X', 105, struct compat_xfs_fsop_handlereq) | |
335 | #define XFS_IOC_FD_TO_HANDLE_32 \ | |
336 | _IOWR('X', 106, struct compat_xfs_fsop_handlereq) | |
337 | #define XFS_IOC_OPEN_BY_HANDLE_32 \ | |
338 | _IOWR('X', 107, struct compat_xfs_fsop_handlereq) | |
339 | #define XFS_IOC_READLINK_BY_HANDLE_32 \ | |
340 | _IOWR('X', 108, struct compat_xfs_fsop_handlereq) | |
341 | ||
342 | STATIC unsigned long xfs_ioctl32_fshandle(unsigned long arg) | |
343 | { | |
344 | compat_xfs_fsop_handlereq_t __user *p32 = (void __user *)arg; | |
345 | xfs_fsop_handlereq_t __user *p = compat_alloc_user_space(sizeof(*p)); | |
346 | u32 addr; | |
347 | ||
348 | if (copy_in_user(&p->fd, &p32->fd, sizeof(__u32)) || | |
349 | get_user(addr, &p32->path) || | |
350 | put_user(compat_ptr(addr), &p->path) || | |
351 | copy_in_user(&p->oflags, &p32->oflags, sizeof(__u32)) || | |
352 | get_user(addr, &p32->ihandle) || | |
353 | put_user(compat_ptr(addr), &p->ihandle) || | |
354 | copy_in_user(&p->ihandlen, &p32->ihandlen, sizeof(__u32)) || | |
355 | get_user(addr, &p32->ohandle) || | |
356 | put_user(compat_ptr(addr), &p->ohandle) || | |
357 | get_user(addr, &p32->ohandlen) || | |
358 | put_user(compat_ptr(addr), &p->ohandlen)) | |
359 | return -EFAULT; | |
360 | ||
361 | return (unsigned long)p; | |
362 | } | |
363 | ||
364 | ||
d3870398 | 365 | STATIC long |
e0edd596 NS |
366 | xfs_compat_ioctl( |
367 | int mode, | |
368 | struct file *file, | |
369 | unsigned cmd, | |
370 | unsigned long arg) | |
1da177e4 | 371 | { |
e678fb0d | 372 | struct inode *inode = file->f_path.dentry->d_inode; |
67fcaa73 | 373 | bhv_vnode_t *vp = vn_from_inode(inode); |
1da177e4 | 374 | int error; |
1da177e4 LT |
375 | |
376 | switch (cmd) { | |
377 | case XFS_IOC_DIOINFO: | |
1da177e4 LT |
378 | case XFS_IOC_FSGEOMETRY: |
379 | case XFS_IOC_GETVERSION: | |
380 | case XFS_IOC_GETXFLAGS: | |
381 | case XFS_IOC_SETXFLAGS: | |
382 | case XFS_IOC_FSGETXATTR: | |
383 | case XFS_IOC_FSSETXATTR: | |
384 | case XFS_IOC_FSGETXATTRA: | |
385 | case XFS_IOC_FSSETDM: | |
386 | case XFS_IOC_GETBMAP: | |
387 | case XFS_IOC_GETBMAPA: | |
388 | case XFS_IOC_GETBMAPX: | |
389 | /* not handled | |
1da177e4 | 390 | case XFS_IOC_FSSETDM_BY_HANDLE: |
1da177e4 LT |
391 | case XFS_IOC_ATTRLIST_BY_HANDLE: |
392 | case XFS_IOC_ATTRMULTI_BY_HANDLE: | |
393 | */ | |
394 | case XFS_IOC_FSCOUNTS: | |
395 | case XFS_IOC_SET_RESBLKS: | |
396 | case XFS_IOC_GET_RESBLKS: | |
397 | case XFS_IOC_FSGROWFSDATA: | |
398 | case XFS_IOC_FSGROWFSLOG: | |
399 | case XFS_IOC_FSGROWFSRT: | |
400 | case XFS_IOC_FREEZE: | |
401 | case XFS_IOC_THAW: | |
402 | case XFS_IOC_GOINGDOWN: | |
403 | case XFS_IOC_ERROR_INJECTION: | |
404 | case XFS_IOC_ERROR_CLEARALL: | |
405 | break; | |
406 | ||
526c420c ES |
407 | #ifdef BROKEN_X86_ALIGNMENT |
408 | /* xfs_flock_t has wrong u32 vs u64 alignment */ | |
409 | case XFS_IOC_ALLOCSP_32: | |
410 | case XFS_IOC_FREESP_32: | |
411 | case XFS_IOC_ALLOCSP64_32: | |
412 | case XFS_IOC_FREESP64_32: | |
413 | case XFS_IOC_RESVSP_32: | |
414 | case XFS_IOC_UNRESVSP_32: | |
415 | case XFS_IOC_RESVSP64_32: | |
416 | case XFS_IOC_UNRESVSP64_32: | |
417 | arg = xfs_ioctl32_flock(arg); | |
418 | cmd = _NATIVE_IOC(cmd, struct xfs_flock64); | |
419 | break; | |
547e00c3 MM |
420 | case XFS_IOC_FSGEOMETRY_V1_32: |
421 | arg = xfs_ioctl32_geom_v1(arg); | |
422 | cmd = _NATIVE_IOC(cmd, struct xfs_fsop_geom_v1); | |
423 | break; | |
526c420c ES |
424 | |
425 | #else /* These are handled fine if no alignment issues */ | |
1da177e4 LT |
426 | case XFS_IOC_ALLOCSP: |
427 | case XFS_IOC_FREESP: | |
428 | case XFS_IOC_RESVSP: | |
429 | case XFS_IOC_UNRESVSP: | |
430 | case XFS_IOC_ALLOCSP64: | |
431 | case XFS_IOC_FREESP64: | |
432 | case XFS_IOC_RESVSP64: | |
433 | case XFS_IOC_UNRESVSP64: | |
547e00c3 | 434 | case XFS_IOC_FSGEOMETRY_V1: |
526c420c ES |
435 | break; |
436 | ||
437 | /* xfs_bstat_t still has wrong u32 vs u64 alignment */ | |
1da177e4 LT |
438 | case XFS_IOC_SWAPEXT: |
439 | break; | |
440 | ||
1da177e4 | 441 | #endif |
faa63e95 MM |
442 | case XFS_IOC_FSBULKSTAT_32: |
443 | case XFS_IOC_FSBULKSTAT_SINGLE_32: | |
444 | case XFS_IOC_FSINUMBERS_32: | |
445 | cmd = _NATIVE_IOC(cmd, struct xfs_fsop_bulkreq); | |
446 | return xfs_ioc_bulkstat_compat(XFS_BHVTOI(VNHEAD(vp))->i_mount, | |
447 | cmd, (void*)arg); | |
1fa503df MM |
448 | case XFS_IOC_FD_TO_HANDLE_32: |
449 | case XFS_IOC_PATH_TO_HANDLE_32: | |
450 | case XFS_IOC_PATH_TO_FSHANDLE_32: | |
451 | case XFS_IOC_OPEN_BY_HANDLE_32: | |
452 | case XFS_IOC_READLINK_BY_HANDLE_32: | |
453 | arg = xfs_ioctl32_fshandle(arg); | |
454 | cmd = _NATIVE_IOC(cmd, struct xfs_fsop_handlereq); | |
455 | break; | |
1da177e4 LT |
456 | default: |
457 | return -ENOIOCTLCMD; | |
458 | } | |
459 | ||
67fcaa73 | 460 | error = bhv_vop_ioctl(vp, inode, file, mode, cmd, (void __user *)arg); |
1da177e4 LT |
461 | VMODIFY(vp); |
462 | ||
463 | return error; | |
464 | } | |
465 | ||
d3870398 | 466 | long |
a50cd269 | 467 | xfs_file_compat_ioctl( |
e0edd596 | 468 | struct file *file, |
d3870398 NS |
469 | unsigned cmd, |
470 | unsigned long arg) | |
1da177e4 | 471 | { |
e0edd596 | 472 | return xfs_compat_ioctl(0, file, cmd, arg); |
1da177e4 LT |
473 | } |
474 | ||
d3870398 | 475 | long |
a50cd269 | 476 | xfs_file_compat_invis_ioctl( |
e0edd596 | 477 | struct file *file, |
d3870398 NS |
478 | unsigned cmd, |
479 | unsigned long arg) | |
1da177e4 | 480 | { |
e0edd596 | 481 | return xfs_compat_ioctl(IO_INVIS, file, cmd, arg); |
1da177e4 | 482 | } |