0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef CEPH_RBD_TYPES_H
0014 #define CEPH_RBD_TYPES_H
0015
0016 #include <linux/types.h>
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #define RBD_HEADER_PREFIX "rbd_header."
0029 #define RBD_OBJECT_MAP_PREFIX "rbd_object_map."
0030 #define RBD_ID_PREFIX "rbd_id."
0031 #define RBD_V2_DATA_FORMAT "%s.%016llx"
0032
0033 #define RBD_LOCK_NAME "rbd_lock"
0034 #define RBD_LOCK_TAG "internal"
0035 #define RBD_LOCK_COOKIE_PREFIX "auto"
0036
0037 enum rbd_notify_op {
0038 RBD_NOTIFY_OP_ACQUIRED_LOCK = 0,
0039 RBD_NOTIFY_OP_RELEASED_LOCK = 1,
0040 RBD_NOTIFY_OP_REQUEST_LOCK = 2,
0041 RBD_NOTIFY_OP_HEADER_UPDATE = 3,
0042 };
0043
0044 #define OBJECT_NONEXISTENT 0
0045 #define OBJECT_EXISTS 1
0046 #define OBJECT_PENDING 2
0047 #define OBJECT_EXISTS_CLEAN 3
0048
0049 #define RBD_FLAG_OBJECT_MAP_INVALID (1ULL << 0)
0050 #define RBD_FLAG_FAST_DIFF_INVALID (1ULL << 1)
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061 #define RBD_SUFFIX ".rbd"
0062 #define RBD_V1_DATA_FORMAT "%s.%012llx"
0063
0064 #define RBD_DIRECTORY "rbd_directory"
0065 #define RBD_INFO "rbd_info"
0066
0067 #define RBD_DEFAULT_OBJ_ORDER 22
0068 #define RBD_MIN_OBJ_ORDER 16
0069 #define RBD_MAX_OBJ_ORDER 30
0070
0071 #define RBD_HEADER_TEXT "<<< Rados Block Device Image >>>\n"
0072 #define RBD_HEADER_SIGNATURE "RBD"
0073 #define RBD_HEADER_VERSION "001.005"
0074
0075 struct rbd_image_snap_ondisk {
0076 __le64 id;
0077 __le64 image_size;
0078 } __attribute__((packed));
0079
0080 struct rbd_image_header_ondisk {
0081 char text[40];
0082 char object_prefix[24];
0083 char signature[4];
0084 char version[8];
0085 struct {
0086 __u8 order;
0087 __u8 crypt_type;
0088 __u8 comp_type;
0089 __u8 unused;
0090 } __attribute__((packed)) options;
0091 __le64 image_size;
0092 __le64 snap_seq;
0093 __le32 snap_count;
0094 __le32 reserved;
0095 __le64 snap_names_len;
0096 struct rbd_image_snap_ondisk snaps[];
0097 } __attribute__((packed));
0098
0099
0100 #endif