0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef OCFS2_IOCTL_H
0011 #define OCFS2_IOCTL_H
0012
0013
0014
0015
0016
0017
0018
0019
0020 struct ocfs2_space_resv {
0021 __s16 l_type;
0022 __s16 l_whence;
0023 __s64 l_start;
0024 __s64 l_len;
0025 __s32 l_sysid;
0026 __u32 l_pid;
0027 __s32 l_pad[4];
0028 };
0029
0030 #define OCFS2_IOC_ALLOCSP _IOW ('X', 10, struct ocfs2_space_resv)
0031 #define OCFS2_IOC_FREESP _IOW ('X', 11, struct ocfs2_space_resv)
0032 #define OCFS2_IOC_RESVSP _IOW ('X', 40, struct ocfs2_space_resv)
0033 #define OCFS2_IOC_UNRESVSP _IOW ('X', 41, struct ocfs2_space_resv)
0034 #define OCFS2_IOC_ALLOCSP64 _IOW ('X', 36, struct ocfs2_space_resv)
0035 #define OCFS2_IOC_FREESP64 _IOW ('X', 37, struct ocfs2_space_resv)
0036 #define OCFS2_IOC_RESVSP64 _IOW ('X', 42, struct ocfs2_space_resv)
0037 #define OCFS2_IOC_UNRESVSP64 _IOW ('X', 43, struct ocfs2_space_resv)
0038
0039
0040 struct ocfs2_new_group_input {
0041 __u64 group;
0042 __u32 clusters;
0043 __u32 frees;
0044 __u16 chain;
0045 __u16 reserved1;
0046 __u32 reserved2;
0047 };
0048
0049 #define OCFS2_IOC_GROUP_EXTEND _IOW('o', 1, int)
0050 #define OCFS2_IOC_GROUP_ADD _IOW('o', 2,struct ocfs2_new_group_input)
0051 #define OCFS2_IOC_GROUP_ADD64 _IOW('o', 3,struct ocfs2_new_group_input)
0052
0053
0054 struct reflink_arguments {
0055 __u64 old_path;
0056 __u64 new_path;
0057 __u64 preserve;
0058 };
0059 #define OCFS2_IOC_REFLINK _IOW('o', 4, struct reflink_arguments)
0060
0061
0062 #define OCFS2_INFO_MAX_REQUEST (50)
0063 #define OCFS2_TEXT_UUID_LEN (OCFS2_VOL_UUID_LEN * 2)
0064
0065
0066 #define OCFS2_INFO_MAGIC (0x4F32494E)
0067
0068
0069
0070
0071
0072 struct ocfs2_info {
0073 __u64 oi_requests;
0074 __u32 oi_count;
0075 __u32 oi_pad;
0076 };
0077
0078 struct ocfs2_info_request {
0079 __u32 ir_magic;
0080 __u32 ir_code;
0081 __u32 ir_size;
0082 __u32 ir_flags;
0083
0084 };
0085
0086 struct ocfs2_info_clustersize {
0087 struct ocfs2_info_request ic_req;
0088 __u32 ic_clustersize;
0089 __u32 ic_pad;
0090 };
0091
0092 struct ocfs2_info_blocksize {
0093 struct ocfs2_info_request ib_req;
0094 __u32 ib_blocksize;
0095 __u32 ib_pad;
0096 };
0097
0098 struct ocfs2_info_maxslots {
0099 struct ocfs2_info_request im_req;
0100 __u32 im_max_slots;
0101 __u32 im_pad;
0102 };
0103
0104 struct ocfs2_info_label {
0105 struct ocfs2_info_request il_req;
0106 __u8 il_label[OCFS2_MAX_VOL_LABEL_LEN];
0107 } __attribute__ ((packed));
0108
0109 struct ocfs2_info_uuid {
0110 struct ocfs2_info_request iu_req;
0111 __u8 iu_uuid_str[OCFS2_TEXT_UUID_LEN + 1];
0112 } __attribute__ ((packed));
0113
0114 struct ocfs2_info_fs_features {
0115 struct ocfs2_info_request if_req;
0116 __u32 if_compat_features;
0117 __u32 if_incompat_features;
0118 __u32 if_ro_compat_features;
0119 __u32 if_pad;
0120 };
0121
0122 struct ocfs2_info_journal_size {
0123 struct ocfs2_info_request ij_req;
0124 __u64 ij_journal_size;
0125 };
0126
0127 struct ocfs2_info_freeinode {
0128 struct ocfs2_info_request ifi_req;
0129 struct ocfs2_info_local_freeinode {
0130 __u64 lfi_total;
0131 __u64 lfi_free;
0132 } ifi_stat[OCFS2_MAX_SLOTS];
0133 __u32 ifi_slotnum;
0134 __u32 ifi_pad;
0135 };
0136
0137 #define OCFS2_INFO_MAX_HIST (32)
0138
0139 struct ocfs2_info_freefrag {
0140 struct ocfs2_info_request iff_req;
0141 struct ocfs2_info_freefrag_stats {
0142 struct ocfs2_info_free_chunk_list {
0143 __u32 fc_chunks[OCFS2_INFO_MAX_HIST];
0144 __u32 fc_clusters[OCFS2_INFO_MAX_HIST];
0145 } ffs_fc_hist;
0146 __u32 ffs_clusters;
0147 __u32 ffs_free_clusters;
0148 __u32 ffs_free_chunks;
0149 __u32 ffs_free_chunks_real;
0150 __u32 ffs_min;
0151 __u32 ffs_max;
0152 __u32 ffs_avg;
0153 __u32 ffs_pad;
0154 } iff_ffs;
0155 __u32 iff_chunksize;
0156 __u32 iff_pad;
0157 };
0158
0159
0160 enum ocfs2_info_type {
0161 OCFS2_INFO_CLUSTERSIZE = 1,
0162 OCFS2_INFO_BLOCKSIZE,
0163 OCFS2_INFO_MAXSLOTS,
0164 OCFS2_INFO_LABEL,
0165 OCFS2_INFO_UUID,
0166 OCFS2_INFO_FS_FEATURES,
0167 OCFS2_INFO_JOURNAL_SIZE,
0168 OCFS2_INFO_FREEINODE,
0169 OCFS2_INFO_FREEFRAG,
0170 OCFS2_INFO_NUM_TYPES
0171 };
0172
0173
0174
0175 #define OCFS2_INFO_FL_NON_COHERENT (0x00000001)
0176
0177
0178
0179
0180
0181 #define OCFS2_INFO_FL_FILLED (0x40000000)
0182
0183
0184
0185 #define OCFS2_INFO_FL_ERROR (0x80000000)
0186
0187
0188 #define OCFS2_IOC_INFO _IOR('o', 5, struct ocfs2_info)
0189
0190 struct ocfs2_move_extents {
0191
0192
0193 __u64 me_start;
0194 __u64 me_len;
0195 __u64 me_goal;
0196
0197 __u64 me_threshold;
0198
0199 __u64 me_flags;
0200
0201
0202
0203
0204 __u64 me_moved_len;
0205 __u64 me_new_offset;
0206 __u32 me_reserved[2];
0207 };
0208
0209 #define OCFS2_MOVE_EXT_FL_AUTO_DEFRAG (0x00000001)
0210
0211
0212
0213 #define OCFS2_MOVE_EXT_FL_PART_DEFRAG (0x00000002)
0214
0215
0216
0217
0218 #define OCFS2_MOVE_EXT_FL_COMPLETE (0x00000004)
0219
0220
0221
0222 #define OCFS2_IOC_MOVE_EXT _IOW('o', 6, struct ocfs2_move_extents)
0223
0224 #endif