1
2
3
4
5
6 #ifndef __XFS_IOCTL32_H__
7 #define __XFS_IOCTL32_H__
8
9 #include <linux/compat.h>
10
11
12
13
14
15
16
17
18
19
20 #define XFS_IOC_GETXFLAGS_32 FS_IOC32_GETFLAGS
21 #define XFS_IOC_SETXFLAGS_32 FS_IOC32_SETFLAGS
22 #define XFS_IOC_GETVERSION_32 FS_IOC32_GETVERSION
23
24
25
26
27 #if defined(CONFIG_IA64) || defined(CONFIG_X86_64)
28 #define BROKEN_X86_ALIGNMENT
29 #define __compat_packed __attribute__((packed))
30 #else
31 #define __compat_packed
32 #endif
33
34 typedef struct compat_xfs_bstime {
35 compat_time_t tv_sec;
36 __s32 tv_nsec;
37 } compat_xfs_bstime_t;
38
39 struct compat_xfs_bstat {
40 __u64 bs_ino;
41 __u16 bs_mode;
42 __u16 bs_nlink;
43 __u32 bs_uid;
44 __u32 bs_gid;
45 __u32 bs_rdev;
46 __s32 bs_blksize;
47 __s64 bs_size;
48 compat_xfs_bstime_t bs_atime;
49 compat_xfs_bstime_t bs_mtime;
50 compat_xfs_bstime_t bs_ctime;
51 int64_t bs_blocks;
52 __u32 bs_xflags;
53 __s32 bs_extsize;
54 __s32 bs_extents;
55 __u32 bs_gen;
56 __u16 bs_projid_lo;
57 #define bs_projid bs_projid_lo
58 __u16 bs_forkoff;
59 __u16 bs_projid_hi;
60 unsigned char bs_pad[10];
61 __u32 bs_dmevmask;
62 __u16 bs_dmstate;
63 __u16 bs_aextents;
64 } __compat_packed;
65
66 struct compat_xfs_fsop_bulkreq {
67 compat_uptr_t lastip;
68 __s32 icount;
69 compat_uptr_t ubuffer;
70 compat_uptr_t ocount;
71 };
72
73 #define XFS_IOC_FSBULKSTAT_32 \
74 _IOWR('X', 101, struct compat_xfs_fsop_bulkreq)
75 #define XFS_IOC_FSBULKSTAT_SINGLE_32 \
76 _IOWR('X', 102, struct compat_xfs_fsop_bulkreq)
77 #define XFS_IOC_FSINUMBERS_32 \
78 _IOWR('X', 103, struct compat_xfs_fsop_bulkreq)
79
80 typedef struct compat_xfs_fsop_handlereq {
81 __u32 fd;
82 compat_uptr_t path;
83 __u32 oflags;
84 compat_uptr_t ihandle;
85 __u32 ihandlen;
86 compat_uptr_t ohandle;
87 compat_uptr_t ohandlen;
88 } compat_xfs_fsop_handlereq_t;
89
90 #define XFS_IOC_PATH_TO_FSHANDLE_32 \
91 _IOWR('X', 104, struct compat_xfs_fsop_handlereq)
92 #define XFS_IOC_PATH_TO_HANDLE_32 \
93 _IOWR('X', 105, struct compat_xfs_fsop_handlereq)
94 #define XFS_IOC_FD_TO_HANDLE_32 \
95 _IOWR('X', 106, struct compat_xfs_fsop_handlereq)
96 #define XFS_IOC_OPEN_BY_HANDLE_32 \
97 _IOWR('X', 107, struct compat_xfs_fsop_handlereq)
98 #define XFS_IOC_READLINK_BY_HANDLE_32 \
99 _IOWR('X', 108, struct compat_xfs_fsop_handlereq)
100
101
102 typedef struct compat_xfs_swapext {
103 int64_t sx_version;
104 int64_t sx_fdtarget;
105 int64_t sx_fdtmp;
106 xfs_off_t sx_offset;
107 xfs_off_t sx_length;
108 char sx_pad[16];
109 struct compat_xfs_bstat sx_stat;
110 } __compat_packed compat_xfs_swapext_t;
111
112 #define XFS_IOC_SWAPEXT_32 _IOWR('X', 109, struct compat_xfs_swapext)
113
114 typedef struct compat_xfs_fsop_attrlist_handlereq {
115 struct compat_xfs_fsop_handlereq hreq;
116 struct xfs_attrlist_cursor pos;
117 __u32 flags;
118 __u32 buflen;
119 compat_uptr_t buffer;
120 } __compat_packed compat_xfs_fsop_attrlist_handlereq_t;
121
122
123 #define XFS_IOC_ATTRLIST_BY_HANDLE_32 \
124 _IOW('X', 122, struct compat_xfs_fsop_attrlist_handlereq)
125
126
127 typedef struct compat_xfs_attr_multiop {
128 __u32 am_opcode;
129 __s32 am_error;
130 compat_uptr_t am_attrname;
131 compat_uptr_t am_attrvalue;
132 __u32 am_length;
133 __u32 am_flags;
134 } compat_xfs_attr_multiop_t;
135
136 typedef struct compat_xfs_fsop_attrmulti_handlereq {
137 struct compat_xfs_fsop_handlereq hreq;
138 __u32 opcount;
139
140 compat_uptr_t ops;
141 } compat_xfs_fsop_attrmulti_handlereq_t;
142
143 #define XFS_IOC_ATTRMULTI_BY_HANDLE_32 \
144 _IOW('X', 123, struct compat_xfs_fsop_attrmulti_handlereq)
145
146 typedef struct compat_xfs_fsop_setdm_handlereq {
147 struct compat_xfs_fsop_handlereq hreq;
148
149 compat_uptr_t data;
150 } compat_xfs_fsop_setdm_handlereq_t;
151
152 #define XFS_IOC_FSSETDM_BY_HANDLE_32 \
153 _IOW('X', 121, struct compat_xfs_fsop_setdm_handlereq)
154
155 #ifdef BROKEN_X86_ALIGNMENT
156
157 typedef struct compat_xfs_flock64 {
158 __s16 l_type;
159 __s16 l_whence;
160 __s64 l_start __attribute__((packed));
161
162 __s64 l_len __attribute__((packed));
163 __s32 l_sysid;
164 __u32 l_pid;
165 __s32 l_pad[4];
166 } compat_xfs_flock64_t;
167
168 #define XFS_IOC_ALLOCSP_32 _IOW('X', 10, struct compat_xfs_flock64)
169 #define XFS_IOC_FREESP_32 _IOW('X', 11, struct compat_xfs_flock64)
170 #define XFS_IOC_ALLOCSP64_32 _IOW('X', 36, struct compat_xfs_flock64)
171 #define XFS_IOC_FREESP64_32 _IOW('X', 37, struct compat_xfs_flock64)
172 #define XFS_IOC_RESVSP_32 _IOW('X', 40, struct compat_xfs_flock64)
173 #define XFS_IOC_UNRESVSP_32 _IOW('X', 41, struct compat_xfs_flock64)
174 #define XFS_IOC_RESVSP64_32 _IOW('X', 42, struct compat_xfs_flock64)
175 #define XFS_IOC_UNRESVSP64_32 _IOW('X', 43, struct compat_xfs_flock64)
176 #define XFS_IOC_ZERO_RANGE_32 _IOW('X', 57, struct compat_xfs_flock64)
177
178 typedef struct compat_xfs_fsop_geom_v1 {
179 __u32 blocksize;
180 __u32 rtextsize;
181 __u32 agblocks;
182 __u32 agcount;
183 __u32 logblocks;
184 __u32 sectsize;
185 __u32 inodesize;
186 __u32 imaxpct;
187 __u64 datablocks;
188 __u64 rtblocks;
189 __u64 rtextents;
190 __u64 logstart;
191 unsigned char uuid[16];
192 __u32 sunit;
193 __u32 swidth;
194 __s32 version;
195 __u32 flags;
196 __u32 logsectsize;
197 __u32 rtsectsize;
198 __u32 dirblocksize;
199 } __attribute__((packed)) compat_xfs_fsop_geom_v1_t;
200
201 #define XFS_IOC_FSGEOMETRY_V1_32 \
202 _IOR('X', 100, struct compat_xfs_fsop_geom_v1)
203
204 struct compat_xfs_inogrp {
205 __u64 xi_startino;
206 __s32 xi_alloccount;
207 __u64 xi_allocmask;
208 } __attribute__((packed));
209
210
211 typedef struct compat_xfs_growfs_data {
212 __u64 newblocks;
213 __u32 imaxpct;
214 } __attribute__((packed)) compat_xfs_growfs_data_t;
215
216 typedef struct compat_xfs_growfs_rt {
217 __u64 newblocks;
218 __u32 extsize;
219 } __attribute__((packed)) compat_xfs_growfs_rt_t;
220
221 #define XFS_IOC_FSGROWFSDATA_32 _IOW('X', 110, struct compat_xfs_growfs_data)
222 #define XFS_IOC_FSGROWFSRT_32 _IOW('X', 112, struct compat_xfs_growfs_rt)
223
224 #endif
225
226 #endif