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