Add linux-next specific files for 20110801
[linux-2.6/next.git] / drivers / block / rbd_types.h
blobfc6c678aa2cb3971333f602eb9d71008d73041ac
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.
13 #ifndef CEPH_RBD_TYPES_H
14 #define CEPH_RBD_TYPES_H
16 #include <linux/types.h>
19 * rbd image 'foo' consists of objects
20 * foo.rbd - image metadata
21 * foo.00000000
22 * foo.00000001
23 * ... - data
26 #define RBD_SUFFIX ".rbd"
27 #define RBD_DIRECTORY "rbd_directory"
28 #define RBD_INFO "rbd_info"
30 #define RBD_DEFAULT_OBJ_ORDER 22 /* 4MB */
31 #define RBD_MIN_OBJ_ORDER 16
32 #define RBD_MAX_OBJ_ORDER 30
34 #define RBD_MAX_OBJ_NAME_LEN 96
35 #define RBD_MAX_SEG_NAME_LEN 128
37 #define RBD_COMP_NONE 0
38 #define RBD_CRYPT_NONE 0
40 #define RBD_HEADER_TEXT "<<< Rados Block Device Image >>>\n"
41 #define RBD_HEADER_SIGNATURE "RBD"
42 #define RBD_HEADER_VERSION "001.005"
44 struct rbd_info {
45 __le64 max_id;
46 } __attribute__ ((packed));
48 struct rbd_image_snap_ondisk {
49 __le64 id;
50 __le64 image_size;
51 } __attribute__((packed));
53 struct rbd_image_header_ondisk {
54 char text[40];
55 char block_name[24];
56 char signature[4];
57 char version[8];
58 struct {
59 __u8 order;
60 __u8 crypt_type;
61 __u8 comp_type;
62 __u8 unused;
63 } __attribute__((packed)) options;
64 __le64 image_size;
65 __le64 snap_seq;
66 __le32 snap_count;
67 __le32 reserved;
68 __le64 snap_names_len;
69 struct rbd_image_snap_ondisk snaps[0];
70 } __attribute__((packed));
73 #endif