2 * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
4 * This copyrighted material is made available to anyone wishing to use,
5 * modify, copy, or redistribute it subject to the terms and conditions
6 * of the GNU Lesser General Public License v.2.1.
8 * You should have received a copy of the GNU Lesser General Public License
9 * along with this program; if not, write to the Free Software Foundation,
10 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
12 #ifndef _LVM_CLOG_CLUSTER_H
13 #define _LVM_CLOG_CLUSTER_H
15 #include "dm-log-userspace.h"
16 #include "libdevmapper.h"
18 #define DM_ULOG_RESPONSE 0x1000U /* in last byte of 32-bit value */
19 #define DM_ULOG_CHECKPOINT_READY 21
20 #define DM_ULOG_MEMBER_JOIN 22
23 * There is other information in addition to what can
24 * be found in the dm_ulog_request structure that we
25 * need for processing. 'clog_request' is the wrapping
26 * structure we use to make the additional fields
31 * If we don't use a union, the structure size will
32 * vary between 32-bit and 64-bit machines. So, we
33 * pack two 64-bit version numbers in there to force
34 * the size of the structure to be the same.
36 * The two version numbers also help us with endian
37 * issues. The first is always little endian, while
38 * the second is in native format of the sending
39 * machine. If the two are equal, there is no need
40 * to do endian conversions.
43 uint64_t version[2]; /* LE version and native version */
48 * 'originator' is the machine from which the requests
54 * 'pit_server' is the "point-in-time" server for the
55 * request. (I.e. The machine that was the server at
56 * the time the request was issued - only important during
62 * The request from the kernel that is being processed
64 struct dm_ulog_request u_rq;
67 int init_cluster(void);
68 void cleanup_cluster(void);
69 void cluster_debug(void);
71 int create_cluster_cpg(char *uuid, uint64_t luid);
72 int destroy_cluster_cpg(char *uuid);
74 int cluster_send(struct clog_request *rq);
76 #endif /* _LVM_CLOG_CLUSTER_H */