1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef __XFS_IOCTL32_H__
19#define __XFS_IOCTL32_H__
20
21#include <linux/compat.h>
22
23
24
25
26
27
28
29
30
31
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
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
46typedef struct compat_xfs_bstime {
47 compat_time_t tv_sec;
48 __s32 tv_nsec;
49} compat_xfs_bstime_t;
50
51typedef struct compat_xfs_bstat {
52 __u64 bs_ino;
53 __u16 bs_mode;
54 __u16 bs_nlink;
55 __u32 bs_uid;
56 __u32 bs_gid;
57 __u32 bs_rdev;
58 __s32 bs_blksize;
59 __s64 bs_size;
60 compat_xfs_bstime_t bs_atime;
61 compat_xfs_bstime_t bs_mtime;
62 compat_xfs_bstime_t bs_ctime;
63 int64_t bs_blocks;
64 __u32 bs_xflags;
65 __s32 bs_extsize;
66 __s32 bs_extents;
67 __u32 bs_gen;
68 __u16 bs_projid;
69 unsigned char bs_pad[14];
70 __u32 bs_dmevmask;
71 __u16 bs_dmstate;
72 __u16 bs_aextents;
73} __compat_packed compat_xfs_bstat_t;
74
75typedef struct compat_xfs_fsop_bulkreq {
76 compat_uptr_t lastip;
77 __s32 icount;
78 compat_uptr_t ubuffer;
79 compat_uptr_t ocount;
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
89typedef struct compat_xfs_fsop_handlereq {
90 __u32 fd;
91 compat_uptr_t path;
92 __u32 oflags;
93 compat_uptr_t ihandle;
94 __u32 ihandlen;
95 compat_uptr_t ohandle;
96 compat_uptr_t ohandlen;
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
111typedef struct compat_xfs_swapext {
112 __int64_t sx_version;
113 __int64_t sx_fdtarget;
114 __int64_t sx_fdtmp;
115 xfs_off_t sx_offset;
116 xfs_off_t sx_length;
117 char sx_pad[16];
118 compat_xfs_bstat_t sx_stat;
119} __compat_packed compat_xfs_swapext_t;
120
121#define XFS_IOC_SWAPEXT_32 _IOWR('X', 109, struct compat_xfs_swapext)
122
123typedef struct compat_xfs_fsop_attrlist_handlereq {
124 struct compat_xfs_fsop_handlereq hreq;
125 struct xfs_attrlist_cursor pos;
126 __u32 flags;
127 __u32 buflen;
128 compat_uptr_t buffer;
129} __compat_packed compat_xfs_fsop_attrlist_handlereq_t;
130
131
132#define XFS_IOC_ATTRLIST_BY_HANDLE_32 \
133 _IOW('X', 122, struct compat_xfs_fsop_attrlist_handlereq)
134
135
136typedef 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
145typedef struct compat_xfs_fsop_attrmulti_handlereq {
146 struct compat_xfs_fsop_handlereq hreq;
147 __u32 opcount;
148
149 compat_uptr_t ops;
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
155typedef struct compat_xfs_fsop_setdm_handlereq {
156 struct compat_xfs_fsop_handlereq hreq;
157
158 compat_uptr_t 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
166typedef struct compat_xfs_flock64 {
167 __s16 l_type;
168 __s16 l_whence;
169 __s64 l_start __attribute__((packed));
170
171 __s64 l_len __attribute__((packed));
172 __s32 l_sysid;
173 __u32 l_pid;
174 __s32 l_pad[4];
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
186typedef struct compat_xfs_fsop_geom_v1 {
187 __u32 blocksize;
188 __u32 rtextsize;
189 __u32 agblocks;
190 __u32 agcount;
191 __u32 logblocks;
192 __u32 sectsize;
193 __u32 inodesize;
194 __u32 imaxpct;
195 __u64 datablocks;
196 __u64 rtblocks;
197 __u64 rtextents;
198 __u64 logstart;
199 unsigned char uuid[16];
200 __u32 sunit;
201 __u32 swidth;
202 __s32 version;
203 __u32 flags;
204 __u32 logsectsize;
205 __u32 rtsectsize;
206 __u32 dirblocksize;
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
212typedef struct compat_xfs_inogrp {
213 __u64 xi_startino;
214 __s32 xi_alloccount;
215 __u64 xi_allocmask;
216} __attribute__((packed)) compat_xfs_inogrp_t;
217
218
219typedef struct compat_xfs_growfs_data {
220 __u64 newblocks;
221 __u32 imaxpct;
222} __attribute__((packed)) compat_xfs_growfs_data_t;
223
224typedef struct compat_xfs_growfs_rt {
225 __u64 newblocks;
226 __u32 extsize;
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
233
234#endif
235