json-streamer: make sure to reset token_size after emitting a token list
[qemu.git] / block / rbd_types.h
blobf4cca9970c1cb2da4cc00b2e1373b95e1cfc5922
1 /*
2 * Ceph - scalable distributed file system
4 * Copyright (C) 2004-2010 Sage Weil <sage@newdream.net>
6 * This is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1, as published by the Free Software
9 * Foundation. See file COPYING.LIB.
13 #ifndef CEPH_RBD_TYPES_H
14 #define CEPH_RBD_TYPES_H
18 * rbd image 'foo' consists of objects
19 * foo.rbd - image metadata
20 * foo.00000000
21 * foo.00000001
22 * ... - data
25 #define RBD_SUFFIX ".rbd"
26 #define RBD_DIRECTORY "rbd_directory"
27 #define RBD_INFO "rbd_info"
29 #define RBD_DEFAULT_OBJ_ORDER 22 /* 4MB */
31 #define RBD_MAX_OBJ_NAME_SIZE 96
32 #define RBD_MAX_BLOCK_NAME_SIZE 24
33 #define RBD_MAX_SEG_NAME_SIZE 128
35 #define RBD_COMP_NONE 0
36 #define RBD_CRYPT_NONE 0
38 #define RBD_HEADER_TEXT "<<< Rados Block Device Image >>>\n"
39 #define RBD_HEADER_SIGNATURE "RBD"
40 #define RBD_HEADER_VERSION "001.005"
42 struct rbd_info {
43 uint64_t max_id;
44 } __attribute__ ((packed));
46 struct rbd_obj_snap_ondisk {
47 uint64_t id;
48 uint64_t image_size;
49 } __attribute__((packed));
51 struct rbd_obj_header_ondisk {
52 char text[40];
53 char block_name[RBD_MAX_BLOCK_NAME_SIZE];
54 char signature[4];
55 char version[8];
56 struct {
57 uint8_t order;
58 uint8_t crypt_type;
59 uint8_t comp_type;
60 uint8_t unused;
61 } __attribute__((packed)) options;
62 uint64_t image_size;
63 uint64_t snap_seq;
64 uint32_t snap_count;
65 uint32_t reserved;
66 uint64_t snap_names_len;
67 struct rbd_obj_snap_ondisk snaps[0];
68 } __attribute__((packed));
71 #endif