diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-30 20:48:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-30 20:48:25 -0500 |
commit | 6a94cb73064c952255336cc57731904174b2c58f (patch) | |
tree | d19cc835db0a21e01909a92772868e1ad96f99ff /fs/xfs/linux-2.6/xfs_ioctl32.h | |
parent | f57fa1d6a6b3414e853d3d17e339ac48816e4406 (diff) | |
parent | 0a8c5395f90f06d128247844b2515c8bf3f2826b (diff) |
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
* 'for-linus' of git://oss.sgi.com/xfs/xfs: (184 commits)
[XFS] Fix race in xfs_write() between direct and buffered I/O with DMAPI
[XFS] handle unaligned data in xfs_bmbt_disk_get_all
[XFS] avoid memory allocations in xfs_fs_vcmn_err
[XFS] Fix speculative allocation beyond eof
[XFS] Remove XFS_BUF_SHUT() and friends
[XFS] Use the incore inode size in xfs_file_readdir()
[XFS] set b_error from bio error in xfs_buf_bio_end_io
[XFS] use inode_change_ok for setattr permission checking
[XFS] add a FMODE flag to make XFS invisible I/O less hacky
[XFS] resync headers with libxfs
[XFS] simplify projid check in xfs_rename
[XFS] replace b_fspriv with b_mount
[XFS] Remove unused tracing code
[XFS] Remove unnecessary assertion
[XFS] Remove unused variable in ktrace_free()
[XFS] Check return value of xfs_buf_get_noaddr()
[XFS] Fix hang after disallowed rename across directory quota domains
[XFS] Fix compile with CONFIG_COMPAT enabled
move inode tracing out of xfs_vnode.
move vn_iowait / vn_iowake into xfs_aops.c
...
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_ioctl32.h')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl32.h | 214 |
1 files changed, 212 insertions, 2 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.h b/fs/xfs/linux-2.6/xfs_ioctl32.h index 02de6e62ee37..1024c4f8ba0d 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl32.h +++ b/fs/xfs/linux-2.6/xfs_ioctl32.h | |||
@@ -18,7 +18,217 @@ | |||
18 | #ifndef __XFS_IOCTL32_H__ | 18 | #ifndef __XFS_IOCTL32_H__ |
19 | #define __XFS_IOCTL32_H__ | 19 | #define __XFS_IOCTL32_H__ |
20 | 20 | ||
21 | extern long xfs_file_compat_ioctl(struct file *, unsigned, unsigned long); | 21 | #include <linux/compat.h> |
22 | extern long xfs_file_compat_invis_ioctl(struct file *, unsigned, unsigned long); | 22 | |
23 | /* | ||
24 | * on 32-bit arches, ioctl argument structures may have different sizes | ||
25 | * and/or alignment. We define compat structures which match the | ||
26 | * 32-bit sizes/alignments here, and their associated ioctl numbers. | ||
27 | * | ||
28 | * xfs_ioctl32.c contains routines to copy these structures in and out. | ||
29 | */ | ||
30 | |||
31 | /* stock kernel-level ioctls we support */ | ||
32 | #define XFS_IOC_GETXFLAGS_32 FS_IOC32_GETFLAGS | ||
33 | #define XFS_IOC_SETXFLAGS_32 FS_IOC32_SETFLAGS | ||
34 | #define XFS_IOC_GETVERSION_32 FS_IOC32_GETVERSION | ||
35 | |||
36 | /* | ||
37 | * On intel, even if sizes match, alignment and/or padding may differ. | ||
38 | */ | ||
39 | #if defined(CONFIG_IA64) || defined(CONFIG_X86_64) | ||
40 | #define BROKEN_X86_ALIGNMENT | ||
41 | #define __compat_packed __attribute__((packed)) | ||
42 | #else | ||
43 | #define __compat_packed | ||
44 | #endif | ||
45 | |||
46 | typedef struct compat_xfs_bstime { | ||
47 | compat_time_t tv_sec; /* seconds */ | ||
48 | __s32 tv_nsec; /* and nanoseconds */ | ||
49 | } compat_xfs_bstime_t; | ||
50 | |||
51 | typedef struct compat_xfs_bstat { | ||
52 | __u64 bs_ino; /* inode number */ | ||
53 | __u16 bs_mode; /* type and mode */ | ||
54 | __u16 bs_nlink; /* number of links */ | ||
55 | __u32 bs_uid; /* user id */ | ||
56 | __u32 bs_gid; /* group id */ | ||
57 | __u32 bs_rdev; /* device value */ | ||
58 | __s32 bs_blksize; /* block size */ | ||
59 | __s64 bs_size; /* file size */ | ||
60 | compat_xfs_bstime_t bs_atime; /* access time */ | ||
61 | compat_xfs_bstime_t bs_mtime; /* modify time */ | ||
62 | compat_xfs_bstime_t bs_ctime; /* inode change time */ | ||
63 | int64_t bs_blocks; /* number of blocks */ | ||
64 | __u32 bs_xflags; /* extended flags */ | ||
65 | __s32 bs_extsize; /* extent size */ | ||
66 | __s32 bs_extents; /* number of extents */ | ||
67 | __u32 bs_gen; /* generation count */ | ||
68 | __u16 bs_projid; /* project id */ | ||
69 | unsigned char bs_pad[14]; /* pad space, unused */ | ||
70 | __u32 bs_dmevmask; /* DMIG event mask */ | ||
71 | __u16 bs_dmstate; /* DMIG state info */ | ||
72 | __u16 bs_aextents; /* attribute number of extents */ | ||
73 | } __compat_packed compat_xfs_bstat_t; | ||
74 | |||
75 | typedef struct compat_xfs_fsop_bulkreq { | ||
76 | compat_uptr_t lastip; /* last inode # pointer */ | ||
77 | __s32 icount; /* count of entries in buffer */ | ||
78 | compat_uptr_t ubuffer; /* user buffer for inode desc. */ | ||
79 | compat_uptr_t ocount; /* output count pointer */ | ||
80 | } compat_xfs_fsop_bulkreq_t; | ||
81 | |||
82 | #define XFS_IOC_FSBULKSTAT_32 \ | ||
83 | _IOWR('X', 101, struct compat_xfs_fsop_bulkreq) | ||
84 | #define XFS_IOC_FSBULKSTAT_SINGLE_32 \ | ||
85 | _IOWR('X', 102, struct compat_xfs_fsop_bulkreq) | ||
86 | #define XFS_IOC_FSINUMBERS_32 \ | ||
87 | _IOWR('X', 103, struct compat_xfs_fsop_bulkreq) | ||
88 | |||
89 | typedef struct compat_xfs_fsop_handlereq { | ||
90 | __u32 fd; /* fd for FD_TO_HANDLE */ | ||
91 | compat_uptr_t path; /* user pathname */ | ||
92 | __u32 oflags; /* open flags */ | ||
93 | compat_uptr_t ihandle; /* user supplied handle */ | ||
94 | __u32 ihandlen; /* user supplied length */ | ||
95 | compat_uptr_t ohandle; /* user buffer for handle */ | ||
96 | compat_uptr_t ohandlen; /* user buffer length */ | ||
97 | } compat_xfs_fsop_handlereq_t; | ||
98 | |||
99 | #define XFS_IOC_PATH_TO_FSHANDLE_32 \ | ||
100 | _IOWR('X', 104, struct compat_xfs_fsop_handlereq) | ||
101 | #define XFS_IOC_PATH_TO_HANDLE_32 \ | ||
102 | _IOWR('X', 105, struct compat_xfs_fsop_handlereq) | ||
103 | #define XFS_IOC_FD_TO_HANDLE_32 \ | ||
104 | _IOWR('X', 106, struct compat_xfs_fsop_handlereq) | ||
105 | #define XFS_IOC_OPEN_BY_HANDLE_32 \ | ||
106 | _IOWR('X', 107, struct compat_xfs_fsop_handlereq) | ||
107 | #define XFS_IOC_READLINK_BY_HANDLE_32 \ | ||
108 | _IOWR('X', 108, struct compat_xfs_fsop_handlereq) | ||
109 | |||
110 | /* The bstat field in the swapext struct needs translation */ | ||
111 | typedef struct compat_xfs_swapext { | ||
112 | __int64_t sx_version; /* version */ | ||
113 | __int64_t sx_fdtarget; /* fd of target file */ | ||
114 | __int64_t sx_fdtmp; /* fd of tmp file */ | ||
115 | xfs_off_t sx_offset; /* offset into file */ | ||
116 | xfs_off_t sx_length; /* leng from offset */ | ||
117 | char sx_pad[16]; /* pad space, unused */ | ||
118 | compat_xfs_bstat_t sx_stat; /* stat of target b4 copy */ | ||
119 | } __compat_packed compat_xfs_swapext_t; | ||
120 | |||
121 | #define XFS_IOC_SWAPEXT_32 _IOWR('X', 109, struct compat_xfs_swapext) | ||
122 | |||
123 | typedef struct compat_xfs_fsop_attrlist_handlereq { | ||
124 | struct compat_xfs_fsop_handlereq hreq; /* handle interface structure */ | ||
125 | struct xfs_attrlist_cursor pos; /* opaque cookie, list offset */ | ||
126 | __u32 flags; /* which namespace to use */ | ||
127 | __u32 buflen; /* length of buffer supplied */ | ||
128 | compat_uptr_t buffer; /* returned names */ | ||
129 | } __compat_packed compat_xfs_fsop_attrlist_handlereq_t; | ||
130 | |||
131 | /* Note: actually this is read/write */ | ||
132 | #define XFS_IOC_ATTRLIST_BY_HANDLE_32 \ | ||
133 | _IOW('X', 122, struct compat_xfs_fsop_attrlist_handlereq) | ||
134 | |||
135 | /* am_opcodes defined in xfs_fs.h */ | ||
136 | typedef struct compat_xfs_attr_multiop { | ||
137 | __u32 am_opcode; | ||
138 | __s32 am_error; | ||
139 | compat_uptr_t am_attrname; | ||
140 | compat_uptr_t am_attrvalue; | ||
141 | __u32 am_length; | ||
142 | __u32 am_flags; | ||
143 | } compat_xfs_attr_multiop_t; | ||
144 | |||
145 | typedef struct compat_xfs_fsop_attrmulti_handlereq { | ||
146 | struct compat_xfs_fsop_handlereq hreq; /* handle interface structure */ | ||
147 | __u32 opcount;/* count of following multiop */ | ||
148 | /* ptr to compat_xfs_attr_multiop */ | ||
149 | compat_uptr_t ops; /* attr_multi data */ | ||
150 | } compat_xfs_fsop_attrmulti_handlereq_t; | ||
151 | |||
152 | #define XFS_IOC_ATTRMULTI_BY_HANDLE_32 \ | ||
153 | _IOW('X', 123, struct compat_xfs_fsop_attrmulti_handlereq) | ||
154 | |||
155 | typedef struct compat_xfs_fsop_setdm_handlereq { | ||
156 | struct compat_xfs_fsop_handlereq hreq; /* handle information */ | ||
157 | /* ptr to struct fsdmidata */ | ||
158 | compat_uptr_t data; /* DMAPI data */ | ||
159 | } compat_xfs_fsop_setdm_handlereq_t; | ||
160 | |||
161 | #define XFS_IOC_FSSETDM_BY_HANDLE_32 \ | ||
162 | _IOW('X', 121, struct compat_xfs_fsop_setdm_handlereq) | ||
163 | |||
164 | #ifdef BROKEN_X86_ALIGNMENT | ||
165 | /* on ia32 l_start is on a 32-bit boundary */ | ||
166 | typedef struct compat_xfs_flock64 { | ||
167 | __s16 l_type; | ||
168 | __s16 l_whence; | ||
169 | __s64 l_start __attribute__((packed)); | ||
170 | /* len == 0 means until end of file */ | ||
171 | __s64 l_len __attribute__((packed)); | ||
172 | __s32 l_sysid; | ||
173 | __u32 l_pid; | ||
174 | __s32 l_pad[4]; /* reserve area */ | ||
175 | } compat_xfs_flock64_t; | ||
176 | |||
177 | #define XFS_IOC_ALLOCSP_32 _IOW('X', 10, struct compat_xfs_flock64) | ||
178 | #define XFS_IOC_FREESP_32 _IOW('X', 11, struct compat_xfs_flock64) | ||
179 | #define XFS_IOC_ALLOCSP64_32 _IOW('X', 36, struct compat_xfs_flock64) | ||
180 | #define XFS_IOC_FREESP64_32 _IOW('X', 37, struct compat_xfs_flock64) | ||
181 | #define XFS_IOC_RESVSP_32 _IOW('X', 40, struct compat_xfs_flock64) | ||
182 | #define XFS_IOC_UNRESVSP_32 _IOW('X', 41, struct compat_xfs_flock64) | ||
183 | #define XFS_IOC_RESVSP64_32 _IOW('X', 42, struct compat_xfs_flock64) | ||
184 | #define XFS_IOC_UNRESVSP64_32 _IOW('X', 43, struct compat_xfs_flock64) | ||
185 | |||
186 | typedef struct compat_xfs_fsop_geom_v1 { | ||
187 | __u32 blocksize; /* filesystem (data) block size */ | ||
188 | __u32 rtextsize; /* realtime extent size */ | ||
189 | __u32 agblocks; /* fsblocks in an AG */ | ||
190 | __u32 agcount; /* number of allocation groups */ | ||
191 | __u32 logblocks; /* fsblocks in the log */ | ||
192 | __u32 sectsize; /* (data) sector size, bytes */ | ||
193 | __u32 inodesize; /* inode size in bytes */ | ||
194 | __u32 imaxpct; /* max allowed inode space(%) */ | ||
195 | __u64 datablocks; /* fsblocks in data subvolume */ | ||
196 | __u64 rtblocks; /* fsblocks in realtime subvol */ | ||
197 | __u64 rtextents; /* rt extents in realtime subvol*/ | ||
198 | __u64 logstart; /* starting fsblock of the log */ | ||
199 | unsigned char uuid[16]; /* unique id of the filesystem */ | ||
200 | __u32 sunit; /* stripe unit, fsblocks */ | ||
201 | __u32 swidth; /* stripe width, fsblocks */ | ||
202 | __s32 version; /* structure version */ | ||
203 | __u32 flags; /* superblock version flags */ | ||
204 | __u32 logsectsize; /* log sector size, bytes */ | ||
205 | __u32 rtsectsize; /* realtime sector size, bytes */ | ||
206 | __u32 dirblocksize; /* directory block size, bytes */ | ||
207 | } __attribute__((packed)) compat_xfs_fsop_geom_v1_t; | ||
208 | |||
209 | #define XFS_IOC_FSGEOMETRY_V1_32 \ | ||
210 | _IOR('X', 100, struct compat_xfs_fsop_geom_v1) | ||
211 | |||
212 | typedef struct compat_xfs_inogrp { | ||
213 | __u64 xi_startino; /* starting inode number */ | ||
214 | __s32 xi_alloccount; /* # bits set in allocmask */ | ||
215 | __u64 xi_allocmask; /* mask of allocated inodes */ | ||
216 | } __attribute__((packed)) compat_xfs_inogrp_t; | ||
217 | |||
218 | /* These growfs input structures have padding on the end, so must translate */ | ||
219 | typedef struct compat_xfs_growfs_data { | ||
220 | __u64 newblocks; /* new data subvol size, fsblocks */ | ||
221 | __u32 imaxpct; /* new inode space percentage limit */ | ||
222 | } __attribute__((packed)) compat_xfs_growfs_data_t; | ||
223 | |||
224 | typedef struct compat_xfs_growfs_rt { | ||
225 | __u64 newblocks; /* new realtime size, fsblocks */ | ||
226 | __u32 extsize; /* new realtime extent size, fsblocks */ | ||
227 | } __attribute__((packed)) compat_xfs_growfs_rt_t; | ||
228 | |||
229 | #define XFS_IOC_FSGROWFSDATA_32 _IOW('X', 110, struct compat_xfs_growfs_data) | ||
230 | #define XFS_IOC_FSGROWFSRT_32 _IOW('X', 112, struct compat_xfs_growfs_rt) | ||
231 | |||
232 | #endif /* BROKEN_X86_ALIGNMENT */ | ||
23 | 233 | ||
24 | #endif /* __XFS_IOCTL32_H__ */ | 234 | #endif /* __XFS_IOCTL32_H__ */ |