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