1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#ifndef OCFS2_IOCTL_H
21#define OCFS2_IOCTL_H
22
23
24
25
26#define OCFS2_IOC_GETFLAGS FS_IOC_GETFLAGS
27#define OCFS2_IOC_SETFLAGS FS_IOC_SETFLAGS
28#define OCFS2_IOC32_GETFLAGS FS_IOC32_GETFLAGS
29#define OCFS2_IOC32_SETFLAGS FS_IOC32_SETFLAGS
30
31
32
33
34
35
36
37
38struct ocfs2_space_resv {
39 __s16 l_type;
40 __s16 l_whence;
41 __s64 l_start;
42 __s64 l_len;
43 __s32 l_sysid;
44 __u32 l_pid;
45 __s32 l_pad[4];
46};
47
48#define OCFS2_IOC_ALLOCSP _IOW ('X', 10, struct ocfs2_space_resv)
49#define OCFS2_IOC_FREESP _IOW ('X', 11, struct ocfs2_space_resv)
50#define OCFS2_IOC_RESVSP _IOW ('X', 40, struct ocfs2_space_resv)
51#define OCFS2_IOC_UNRESVSP _IOW ('X', 41, struct ocfs2_space_resv)
52#define OCFS2_IOC_ALLOCSP64 _IOW ('X', 36, struct ocfs2_space_resv)
53#define OCFS2_IOC_FREESP64 _IOW ('X', 37, struct ocfs2_space_resv)
54#define OCFS2_IOC_RESVSP64 _IOW ('X', 42, struct ocfs2_space_resv)
55#define OCFS2_IOC_UNRESVSP64 _IOW ('X', 43, struct ocfs2_space_resv)
56
57
58struct ocfs2_new_group_input {
59 __u64 group;
60 __u32 clusters;
61 __u32 frees;
62 __u16 chain;
63 __u16 reserved1;
64 __u32 reserved2;
65};
66
67#define OCFS2_IOC_GROUP_EXTEND _IOW('o', 1, int)
68#define OCFS2_IOC_GROUP_ADD _IOW('o', 2,struct ocfs2_new_group_input)
69#define OCFS2_IOC_GROUP_ADD64 _IOW('o', 3,struct ocfs2_new_group_input)
70
71
72struct reflink_arguments {
73 __u64 old_path;
74 __u64 new_path;
75 __u64 preserve;
76};
77#define OCFS2_IOC_REFLINK _IOW('o', 4, struct reflink_arguments)
78
79
80#define OCFS2_INFO_MAX_REQUEST (50)
81#define OCFS2_TEXT_UUID_LEN (OCFS2_VOL_UUID_LEN * 2)
82
83
84#define OCFS2_INFO_MAGIC (0x4F32494E)
85
86
87
88
89
90struct ocfs2_info {
91 __u64 oi_requests;
92 __u32 oi_count;
93 __u32 oi_pad;
94};
95
96struct ocfs2_info_request {
97 __u32 ir_magic;
98 __u32 ir_code;
99 __u32 ir_size;
100 __u32 ir_flags;
101
102};
103
104struct ocfs2_info_clustersize {
105 struct ocfs2_info_request ic_req;
106 __u32 ic_clustersize;
107 __u32 ic_pad;
108};
109
110struct ocfs2_info_blocksize {
111 struct ocfs2_info_request ib_req;
112 __u32 ib_blocksize;
113 __u32 ib_pad;
114};
115
116struct ocfs2_info_maxslots {
117 struct ocfs2_info_request im_req;
118 __u32 im_max_slots;
119 __u32 im_pad;
120};
121
122struct ocfs2_info_label {
123 struct ocfs2_info_request il_req;
124 __u8 il_label[OCFS2_MAX_VOL_LABEL_LEN];
125} __attribute__ ((packed));
126
127struct ocfs2_info_uuid {
128 struct ocfs2_info_request iu_req;
129 __u8 iu_uuid_str[OCFS2_TEXT_UUID_LEN + 1];
130} __attribute__ ((packed));
131
132struct ocfs2_info_fs_features {
133 struct ocfs2_info_request if_req;
134 __u32 if_compat_features;
135 __u32 if_incompat_features;
136 __u32 if_ro_compat_features;
137 __u32 if_pad;
138};
139
140struct ocfs2_info_journal_size {
141 struct ocfs2_info_request ij_req;
142 __u64 ij_journal_size;
143};
144
145struct ocfs2_info_freeinode {
146 struct ocfs2_info_request ifi_req;
147 struct ocfs2_info_local_freeinode {
148 __u64 lfi_total;
149 __u64 lfi_free;
150 } ifi_stat[OCFS2_MAX_SLOTS];
151 __u32 ifi_slotnum;
152 __u32 ifi_pad;
153};
154
155#define OCFS2_INFO_MAX_HIST (32)
156
157struct ocfs2_info_freefrag {
158 struct ocfs2_info_request iff_req;
159 struct ocfs2_info_freefrag_stats {
160 struct ocfs2_info_free_chunk_list {
161 __u32 fc_chunks[OCFS2_INFO_MAX_HIST];
162 __u32 fc_clusters[OCFS2_INFO_MAX_HIST];
163 } ffs_fc_hist;
164 __u32 ffs_clusters;
165 __u32 ffs_free_clusters;
166 __u32 ffs_free_chunks;
167 __u32 ffs_free_chunks_real;
168 __u32 ffs_min;
169 __u32 ffs_max;
170 __u32 ffs_avg;
171 __u32 ffs_pad;
172 } iff_ffs;
173 __u32 iff_chunksize;
174 __u32 iff_pad;
175};
176
177
178enum ocfs2_info_type {
179 OCFS2_INFO_CLUSTERSIZE = 1,
180 OCFS2_INFO_BLOCKSIZE,
181 OCFS2_INFO_MAXSLOTS,
182 OCFS2_INFO_LABEL,
183 OCFS2_INFO_UUID,
184 OCFS2_INFO_FS_FEATURES,
185 OCFS2_INFO_JOURNAL_SIZE,
186 OCFS2_INFO_FREEINODE,
187 OCFS2_INFO_FREEFRAG,
188 OCFS2_INFO_NUM_TYPES
189};
190
191
192
193#define OCFS2_INFO_FL_NON_COHERENT (0x00000001)
194
195
196
197
198
199#define OCFS2_INFO_FL_FILLED (0x40000000)
200
201
202
203#define OCFS2_INFO_FL_ERROR (0x80000000)
204
205
206#define OCFS2_IOC_INFO _IOR('o', 5, struct ocfs2_info)
207
208struct ocfs2_move_extents {
209
210
211 __u64 me_start;
212 __u64 me_len;
213 __u64 me_goal;
214
215 __u64 me_threshold;
216
217 __u64 me_flags;
218
219
220
221
222 __u64 me_moved_len;
223 __u64 me_new_offset;
224 __u32 me_reserved[2];
225};
226
227#define OCFS2_MOVE_EXT_FL_AUTO_DEFRAG (0x00000001)
228
229
230
231#define OCFS2_MOVE_EXT_FL_PART_DEFRAG (0x00000002)
232
233
234
235
236#define OCFS2_MOVE_EXT_FL_COMPLETE (0x00000004)
237
238
239
240#define OCFS2_IOC_MOVE_EXT _IOW('o', 6, struct ocfs2_move_extents)
241
242#endif
243