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