2009-09-26 07:07:19 +08:00
|
|
|
/*
|
|
|
|
drbd.h
|
|
|
|
Kernel module for 2.6.x Kernels
|
|
|
|
|
|
|
|
This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
|
|
|
|
|
|
|
|
Copyright (C) 2001-2008, LINBIT Information Technologies GmbH.
|
|
|
|
Copyright (C) 2001-2008, Philipp Reisner <philipp.reisner@linbit.com>.
|
|
|
|
Copyright (C) 2001-2008, Lars Ellenberg <lars.ellenberg@linbit.com>.
|
|
|
|
|
|
|
|
drbd is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
drbd is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with drbd; see the file COPYING. If not, write to
|
|
|
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
#ifndef DRBD_H
|
|
|
|
#define DRBD_H
|
|
|
|
#include <linux/connector.h>
|
|
|
|
#include <asm/types.h>
|
|
|
|
|
|
|
|
#ifdef __KERNEL__
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <asm/byteorder.h>
|
|
|
|
#else
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/wait.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
2011-03-31 09:57:33 +08:00
|
|
|
/* Although the Linux source code makes a difference between
|
2009-09-26 07:07:19 +08:00
|
|
|
generic endianness and the bitfields' endianness, there is no
|
2011-05-22 00:32:29 +08:00
|
|
|
architecture as of Linux-2.6.24-rc4 where the bitfields' endianness
|
2009-09-26 07:07:19 +08:00
|
|
|
does not match the generic endianness. */
|
|
|
|
|
|
|
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
|
|
|
#define __LITTLE_ENDIAN_BITFIELD
|
|
|
|
#elif __BYTE_ORDER == __BIG_ENDIAN
|
|
|
|
#define __BIG_ENDIAN_BITFIELD
|
|
|
|
#else
|
|
|
|
# error "sorry, weird endianness on this box"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern const char *drbd_buildtag(void);
|
2014-05-06 19:28:32 +08:00
|
|
|
#define REL_VERSION "8.4.5"
|
2012-10-19 20:37:47 +08:00
|
|
|
#define API_VERSION 1
|
2009-09-26 07:07:19 +08:00
|
|
|
#define PRO_VERSION_MIN 86
|
2012-07-26 20:09:49 +08:00
|
|
|
#define PRO_VERSION_MAX 101
|
2009-09-26 07:07:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
enum drbd_io_error_p {
|
|
|
|
EP_PASS_ON, /* FIXME should the better be named "Ignore"? */
|
|
|
|
EP_CALL_HELPER,
|
|
|
|
EP_DETACH
|
|
|
|
};
|
|
|
|
|
|
|
|
enum drbd_fencing_p {
|
2011-03-24 18:03:07 +08:00
|
|
|
FP_NOT_AVAIL = -1, /* Not a policy */
|
|
|
|
FP_DONT_CARE = 0,
|
2009-09-26 07:07:19 +08:00
|
|
|
FP_RESOURCE,
|
|
|
|
FP_STONITH
|
|
|
|
};
|
|
|
|
|
|
|
|
enum drbd_disconnect_p {
|
|
|
|
DP_RECONNECT,
|
|
|
|
DP_DROP_NET_CONF,
|
|
|
|
DP_FREEZE_IO
|
|
|
|
};
|
|
|
|
|
|
|
|
enum drbd_after_sb_p {
|
|
|
|
ASB_DISCONNECT,
|
|
|
|
ASB_DISCARD_YOUNGER_PRI,
|
|
|
|
ASB_DISCARD_OLDER_PRI,
|
|
|
|
ASB_DISCARD_ZERO_CHG,
|
|
|
|
ASB_DISCARD_LEAST_CHG,
|
|
|
|
ASB_DISCARD_LOCAL,
|
|
|
|
ASB_DISCARD_REMOTE,
|
|
|
|
ASB_CONSENSUS,
|
|
|
|
ASB_DISCARD_SECONDARY,
|
|
|
|
ASB_CALL_HELPER,
|
|
|
|
ASB_VIOLENTLY
|
|
|
|
};
|
|
|
|
|
2010-05-31 16:14:17 +08:00
|
|
|
enum drbd_on_no_data {
|
|
|
|
OND_IO_ERROR,
|
|
|
|
OND_SUSPEND_IO
|
|
|
|
};
|
|
|
|
|
2010-10-27 17:12:07 +08:00
|
|
|
enum drbd_on_congestion {
|
|
|
|
OC_BLOCK,
|
|
|
|
OC_PULL_AHEAD,
|
|
|
|
OC_DISCONNECT,
|
|
|
|
};
|
|
|
|
|
2011-11-11 19:31:20 +08:00
|
|
|
enum drbd_read_balancing {
|
|
|
|
RB_PREFER_LOCAL,
|
|
|
|
RB_PREFER_REMOTE,
|
|
|
|
RB_ROUND_ROBIN,
|
|
|
|
RB_LEAST_PENDING,
|
|
|
|
RB_CONGESTED_REMOTE,
|
2011-11-17 17:12:31 +08:00
|
|
|
RB_32K_STRIPING,
|
|
|
|
RB_64K_STRIPING,
|
|
|
|
RB_128K_STRIPING,
|
|
|
|
RB_256K_STRIPING,
|
|
|
|
RB_512K_STRIPING,
|
|
|
|
RB_1M_STRIPING,
|
2011-11-11 19:31:20 +08:00
|
|
|
};
|
|
|
|
|
2009-09-26 07:07:19 +08:00
|
|
|
/* KEEP the order, do not delete or insert. Only append. */
|
2010-12-08 20:33:11 +08:00
|
|
|
enum drbd_ret_code {
|
2009-09-26 07:07:19 +08:00
|
|
|
ERR_CODE_BASE = 100,
|
|
|
|
NO_ERROR = 101,
|
|
|
|
ERR_LOCAL_ADDR = 102,
|
|
|
|
ERR_PEER_ADDR = 103,
|
|
|
|
ERR_OPEN_DISK = 104,
|
|
|
|
ERR_OPEN_MD_DISK = 105,
|
|
|
|
ERR_DISK_NOT_BDEV = 107,
|
|
|
|
ERR_MD_NOT_BDEV = 108,
|
2011-06-06 21:36:04 +08:00
|
|
|
ERR_DISK_TOO_SMALL = 111,
|
|
|
|
ERR_MD_DISK_TOO_SMALL = 112,
|
2009-09-26 07:07:19 +08:00
|
|
|
ERR_BDCLAIM_DISK = 114,
|
|
|
|
ERR_BDCLAIM_MD_DISK = 115,
|
|
|
|
ERR_MD_IDX_INVALID = 116,
|
|
|
|
ERR_IO_MD_DISK = 118,
|
|
|
|
ERR_MD_INVALID = 119,
|
|
|
|
ERR_AUTH_ALG = 120,
|
|
|
|
ERR_AUTH_ALG_ND = 121,
|
|
|
|
ERR_NOMEM = 122,
|
2012-08-01 18:46:20 +08:00
|
|
|
ERR_DISCARD_IMPOSSIBLE = 123,
|
2009-09-26 07:07:19 +08:00
|
|
|
ERR_DISK_CONFIGURED = 124,
|
|
|
|
ERR_NET_CONFIGURED = 125,
|
|
|
|
ERR_MANDATORY_TAG = 126,
|
|
|
|
ERR_MINOR_INVALID = 127,
|
|
|
|
ERR_INTR = 129, /* EINTR */
|
|
|
|
ERR_RESIZE_RESYNC = 130,
|
|
|
|
ERR_NO_PRIMARY = 131,
|
2011-05-12 17:15:34 +08:00
|
|
|
ERR_RESYNC_AFTER = 132,
|
|
|
|
ERR_RESYNC_AFTER_CYCLE = 133,
|
2009-09-26 07:07:19 +08:00
|
|
|
ERR_PAUSE_IS_SET = 134,
|
|
|
|
ERR_PAUSE_IS_CLEAR = 135,
|
|
|
|
ERR_PACKET_NR = 137,
|
|
|
|
ERR_NO_DISK = 138,
|
|
|
|
ERR_NOT_PROTO_C = 139,
|
|
|
|
ERR_NOMEM_BITMAP = 140,
|
|
|
|
ERR_INTEGRITY_ALG = 141, /* DRBD 8.2 only */
|
|
|
|
ERR_INTEGRITY_ALG_ND = 142, /* DRBD 8.2 only */
|
|
|
|
ERR_CPU_MASK_PARSE = 143, /* DRBD 8.2 only */
|
|
|
|
ERR_CSUMS_ALG = 144, /* DRBD 8.2 only */
|
|
|
|
ERR_CSUMS_ALG_ND = 145, /* DRBD 8.2 only */
|
|
|
|
ERR_VERIFY_ALG = 146, /* DRBD 8.2 only */
|
|
|
|
ERR_VERIFY_ALG_ND = 147, /* DRBD 8.2 only */
|
|
|
|
ERR_CSUMS_RESYNC_RUNNING= 148, /* DRBD 8.2 only */
|
|
|
|
ERR_VERIFY_RUNNING = 149, /* DRBD 8.2 only */
|
|
|
|
ERR_DATA_NOT_CURRENT = 150,
|
|
|
|
ERR_CONNECTED = 151, /* DRBD 8.3 only */
|
2009-10-06 15:30:14 +08:00
|
|
|
ERR_PERM = 152,
|
2010-03-24 23:07:04 +08:00
|
|
|
ERR_NEED_APV_93 = 153,
|
2010-06-18 19:56:57 +08:00
|
|
|
ERR_STONITH_AND_PROT_A = 154,
|
2010-10-27 17:12:07 +08:00
|
|
|
ERR_CONG_NOT_PROTO_A = 155,
|
2011-01-20 18:46:41 +08:00
|
|
|
ERR_PIC_AFTER_DEP = 156,
|
|
|
|
ERR_PIC_PEER_DEP = 157,
|
2011-06-06 22:16:44 +08:00
|
|
|
ERR_RES_NOT_KNOWN = 158,
|
|
|
|
ERR_RES_IN_USE = 159,
|
2011-02-22 15:07:03 +08:00
|
|
|
ERR_MINOR_CONFIGURED = 160,
|
|
|
|
ERR_MINOR_EXISTS = 161,
|
2011-03-07 19:49:34 +08:00
|
|
|
ERR_INVALID_REQUEST = 162,
|
2011-04-14 09:16:10 +08:00
|
|
|
ERR_NEED_APV_100 = 163,
|
2011-05-16 20:30:24 +08:00
|
|
|
ERR_NEED_ALLOW_TWO_PRI = 164,
|
drbd: on attach, enforce clean meta data
Detection of unclean shutdown has moved into user space.
The kernel code will, whenever it updates the meta data, mark it as
"unclean", and will refuse to attach to such unclean meta data.
"drbdadm up" now schedules "drbdmeta apply-al", which will apply
the activity log to the bitmap, and/or reinitialize it, if necessary,
as well as set a "clean" indicator flag.
This moves a bit code out of kernel space.
As a side effect, it also prevents some 8.3 module from accidentally
ignoring the 8.4 style activity log, if someone should downgrade,
whether on purpose, or accidentally because he changed kernel versions
without providing an 8.4 for the new kernel, and the new kernel comes
with in-tree 8.3.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2011-07-06 02:59:26 +08:00
|
|
|
ERR_MD_UNCLEAN = 165,
|
2013-06-25 22:50:08 +08:00
|
|
|
ERR_MD_LAYOUT_CONNECTED = 166,
|
|
|
|
ERR_MD_LAYOUT_TOO_BIG = 167,
|
|
|
|
ERR_MD_LAYOUT_TOO_SMALL = 168,
|
|
|
|
ERR_MD_LAYOUT_NO_FIT = 169,
|
|
|
|
ERR_IMPLICIT_SHRINK = 170,
|
2009-09-26 07:07:19 +08:00
|
|
|
/* insert new ones above this line */
|
|
|
|
AFTER_LAST_ERR_CODE
|
|
|
|
};
|
|
|
|
|
|
|
|
#define DRBD_PROT_A 1
|
|
|
|
#define DRBD_PROT_B 2
|
|
|
|
#define DRBD_PROT_C 3
|
|
|
|
|
|
|
|
enum drbd_role {
|
|
|
|
R_UNKNOWN = 0,
|
|
|
|
R_PRIMARY = 1, /* role */
|
|
|
|
R_SECONDARY = 2, /* role */
|
|
|
|
R_MASK = 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
/* The order of these constants is important.
|
|
|
|
* The lower ones (<C_WF_REPORT_PARAMS) indicate
|
|
|
|
* that there is no socket!
|
|
|
|
* >=C_WF_REPORT_PARAMS ==> There is a socket
|
|
|
|
*/
|
|
|
|
enum drbd_conns {
|
|
|
|
C_STANDALONE,
|
|
|
|
C_DISCONNECTING, /* Temporal state on the way to StandAlone. */
|
|
|
|
C_UNCONNECTED, /* >= C_UNCONNECTED -> inc_net() succeeds */
|
|
|
|
|
|
|
|
/* These temporal states are all used on the way
|
|
|
|
* from >= C_CONNECTED to Unconnected.
|
|
|
|
* The 'disconnect reason' states
|
2011-03-31 09:57:33 +08:00
|
|
|
* I do not allow to change between them. */
|
2009-09-26 07:07:19 +08:00
|
|
|
C_TIMEOUT,
|
|
|
|
C_BROKEN_PIPE,
|
|
|
|
C_NETWORK_FAILURE,
|
|
|
|
C_PROTOCOL_ERROR,
|
|
|
|
C_TEAR_DOWN,
|
|
|
|
|
|
|
|
C_WF_CONNECTION,
|
|
|
|
C_WF_REPORT_PARAMS, /* we have a socket */
|
|
|
|
C_CONNECTED, /* we have introduced each other */
|
|
|
|
C_STARTING_SYNC_S, /* starting full sync by admin request. */
|
2011-05-22 00:32:29 +08:00
|
|
|
C_STARTING_SYNC_T, /* starting full sync by admin request. */
|
2009-09-26 07:07:19 +08:00
|
|
|
C_WF_BITMAP_S,
|
|
|
|
C_WF_BITMAP_T,
|
|
|
|
C_WF_SYNC_UUID,
|
|
|
|
|
|
|
|
/* All SyncStates are tested with this comparison
|
|
|
|
* xx >= C_SYNC_SOURCE && xx <= C_PAUSED_SYNC_T */
|
|
|
|
C_SYNC_SOURCE,
|
|
|
|
C_SYNC_TARGET,
|
|
|
|
C_VERIFY_S,
|
|
|
|
C_VERIFY_T,
|
|
|
|
C_PAUSED_SYNC_S,
|
|
|
|
C_PAUSED_SYNC_T,
|
2010-10-27 18:21:30 +08:00
|
|
|
|
|
|
|
C_AHEAD,
|
|
|
|
C_BEHIND,
|
|
|
|
|
2009-09-26 07:07:19 +08:00
|
|
|
C_MASK = 31
|
|
|
|
};
|
|
|
|
|
|
|
|
enum drbd_disk_state {
|
|
|
|
D_DISKLESS,
|
|
|
|
D_ATTACHING, /* In the process of reading the meta-data */
|
|
|
|
D_FAILED, /* Becomes D_DISKLESS as soon as we told it the peer */
|
drbd: device->ldev is not guaranteed on an D_ATTACHING disk
Some parts of the code assumed that get_ldev_if_state(device, D_ATTACHING)
is sufficient to access the ldev member of the device object. That was
wrong. ldev may not be there or might be freed at any time if the device
has a disk state of D_ATTACHING.
bm_rw()
Documented that drbd_bm_read() is only called from drbd_adm_attach.
drbd_bm_write() is only called when a reference is held, and it is
documented that a caller has to hold a reference before calling
drbd_bm_write()
drbd_bm_write_page()
Use get_ldev() instead of get_ldev_if_state(device, D_ATTACHING)
drbd_bmio_set_n_write()
No longer use get_ldev_if_state(device, D_ATTACHING). All callers
hold a reference to ldev now.
drbd_bmio_clear_n_write()
All callers where holding a reference of ldev anyways. Remove the
misleading get_ldev_if_state(device, D_ATTACHING)
drbd_reconsider_max_bio_size()
Removed the get_ldev_if_state(device, D_ATTACHING). All callers
now pass a struct drbd_backing_dev* when they have a proper
reference, or a NULL pointer.
Before this fix, the receiver could trigger a NULL pointer
deref when in drbd_reconsider_max_bio_size()
drbd_bump_write_ordering()
Used get_ldev_if_state(device, D_ATTACHING) with the wrong assumption.
Remove it, and allow the caller to pass in a struct drbd_backing_dev*
when the caller knows that accessing this bdev is safe.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2013-11-22 20:22:13 +08:00
|
|
|
/* when >= D_FAILED it is legal to access mdev->ldev */
|
2009-09-26 07:07:19 +08:00
|
|
|
D_NEGOTIATING, /* Late attaching state, we need to talk to the peer */
|
|
|
|
D_INCONSISTENT,
|
|
|
|
D_OUTDATED,
|
|
|
|
D_UNKNOWN, /* Only used for the peer, never for myself */
|
|
|
|
D_CONSISTENT, /* Might be D_OUTDATED, might be D_UP_TO_DATE ... */
|
|
|
|
D_UP_TO_DATE, /* Only this disk state allows applications' IO ! */
|
|
|
|
D_MASK = 15
|
|
|
|
};
|
|
|
|
|
|
|
|
union drbd_state {
|
|
|
|
/* According to gcc's docs is the ...
|
|
|
|
* The order of allocation of bit-fields within a unit (C90 6.5.2.1, C99 6.7.2.1).
|
|
|
|
* Determined by ABI.
|
|
|
|
* pointed out by Maxim Uvarov q<muvarov@ru.mvista.com>
|
|
|
|
* even though we transmit as "cpu_to_be32(state)",
|
|
|
|
* the offsets of the bitfields still need to be swapped
|
2011-05-22 00:32:29 +08:00
|
|
|
* on different endianness.
|
2009-09-26 07:07:19 +08:00
|
|
|
*/
|
|
|
|
struct {
|
|
|
|
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
|
|
|
unsigned role:2 ; /* 3/4 primary/secondary/unknown */
|
|
|
|
unsigned peer:2 ; /* 3/4 primary/secondary/unknown */
|
|
|
|
unsigned conn:5 ; /* 17/32 cstates */
|
|
|
|
unsigned disk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
|
|
|
|
unsigned pdsk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
|
2010-09-09 05:20:21 +08:00
|
|
|
unsigned susp:1 ; /* 2/2 IO suspended no/yes (by user) */
|
2009-09-26 07:07:19 +08:00
|
|
|
unsigned aftr_isp:1 ; /* isp .. imposed sync pause */
|
|
|
|
unsigned peer_isp:1 ;
|
|
|
|
unsigned user_isp:1 ;
|
2010-09-09 05:20:21 +08:00
|
|
|
unsigned susp_nod:1 ; /* IO suspended because no data */
|
|
|
|
unsigned susp_fen:1 ; /* IO suspended because fence peer handler runs*/
|
|
|
|
unsigned _pad:9; /* 0 unused */
|
2009-09-26 07:07:19 +08:00
|
|
|
#elif defined(__BIG_ENDIAN_BITFIELD)
|
2010-09-09 05:20:21 +08:00
|
|
|
unsigned _pad:9;
|
|
|
|
unsigned susp_fen:1 ;
|
|
|
|
unsigned susp_nod:1 ;
|
2009-09-26 07:07:19 +08:00
|
|
|
unsigned user_isp:1 ;
|
|
|
|
unsigned peer_isp:1 ;
|
|
|
|
unsigned aftr_isp:1 ; /* isp .. imposed sync pause */
|
|
|
|
unsigned susp:1 ; /* 2/2 IO suspended no/yes */
|
|
|
|
unsigned pdsk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
|
|
|
|
unsigned disk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
|
|
|
|
unsigned conn:5 ; /* 17/32 cstates */
|
|
|
|
unsigned peer:2 ; /* 3/4 primary/secondary/unknown */
|
|
|
|
unsigned role:2 ; /* 3/4 primary/secondary/unknown */
|
|
|
|
#else
|
2011-05-22 00:32:29 +08:00
|
|
|
# error "this endianness is not supported"
|
2009-09-26 07:07:19 +08:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
unsigned int i;
|
|
|
|
};
|
|
|
|
|
2010-12-08 08:06:16 +08:00
|
|
|
enum drbd_state_rv {
|
2009-09-26 07:07:19 +08:00
|
|
|
SS_CW_NO_NEED = 4,
|
|
|
|
SS_CW_SUCCESS = 3,
|
|
|
|
SS_NOTHING_TO_DO = 2,
|
|
|
|
SS_SUCCESS = 1,
|
|
|
|
SS_UNKNOWN_ERROR = 0, /* Used to sleep longer in _drbd_request_state */
|
|
|
|
SS_TWO_PRIMARIES = -1,
|
|
|
|
SS_NO_UP_TO_DATE_DISK = -2,
|
|
|
|
SS_NO_LOCAL_DISK = -4,
|
|
|
|
SS_NO_REMOTE_DISK = -5,
|
|
|
|
SS_CONNECTED_OUTDATES = -6,
|
|
|
|
SS_PRIMARY_NOP = -7,
|
|
|
|
SS_RESYNC_RUNNING = -8,
|
|
|
|
SS_ALREADY_STANDALONE = -9,
|
|
|
|
SS_CW_FAILED_BY_PEER = -10,
|
|
|
|
SS_IS_DISKLESS = -11,
|
|
|
|
SS_DEVICE_IN_USE = -12,
|
|
|
|
SS_NO_NET_CONFIG = -13,
|
|
|
|
SS_NO_VERIFY_ALG = -14, /* drbd-8.2 only */
|
|
|
|
SS_NEED_CONNECTION = -15, /* drbd-8.2 only */
|
|
|
|
SS_LOWER_THAN_OUTDATED = -16,
|
|
|
|
SS_NOT_SUPPORTED = -17, /* drbd-8.2 only */
|
|
|
|
SS_IN_TRANSIENT_STATE = -18, /* Retry after the next state change */
|
|
|
|
SS_CONCURRENT_ST_CHG = -19, /* Concurrent cluster side state change! */
|
2011-03-16 21:43:36 +08:00
|
|
|
SS_O_VOL_PEER_PRI = -20,
|
2013-03-27 21:08:40 +08:00
|
|
|
SS_OUTDATE_WO_CONN = -21,
|
|
|
|
SS_AFTER_LAST_ERROR = -22, /* Keep this at bottom */
|
2009-09-26 07:07:19 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#define SHARED_SECRET_MAX 64
|
|
|
|
|
|
|
|
#define MDF_CONSISTENT (1 << 0)
|
|
|
|
#define MDF_PRIMARY_IND (1 << 1)
|
|
|
|
#define MDF_CONNECTED_IND (1 << 2)
|
|
|
|
#define MDF_FULL_SYNC (1 << 3)
|
|
|
|
#define MDF_WAS_UP_TO_DATE (1 << 4)
|
|
|
|
#define MDF_PEER_OUT_DATED (1 << 5)
|
drbd: on attach, enforce clean meta data
Detection of unclean shutdown has moved into user space.
The kernel code will, whenever it updates the meta data, mark it as
"unclean", and will refuse to attach to such unclean meta data.
"drbdadm up" now schedules "drbdmeta apply-al", which will apply
the activity log to the bitmap, and/or reinitialize it, if necessary,
as well as set a "clean" indicator flag.
This moves a bit code out of kernel space.
As a side effect, it also prevents some 8.3 module from accidentally
ignoring the 8.4 style activity log, if someone should downgrade,
whether on purpose, or accidentally because he changed kernel versions
without providing an 8.4 for the new kernel, and the new kernel comes
with in-tree 8.3.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2011-07-06 02:59:26 +08:00
|
|
|
#define MDF_CRASHED_PRIMARY (1 << 6)
|
|
|
|
#define MDF_AL_CLEAN (1 << 7)
|
2012-02-21 04:53:28 +08:00
|
|
|
#define MDF_AL_DISABLED (1 << 8)
|
2009-09-26 07:07:19 +08:00
|
|
|
|
|
|
|
enum drbd_uuid_index {
|
|
|
|
UI_CURRENT,
|
|
|
|
UI_BITMAP,
|
|
|
|
UI_HISTORY_START,
|
|
|
|
UI_HISTORY_END,
|
|
|
|
UI_SIZE, /* nl-packet: number of dirty bits */
|
|
|
|
UI_FLAGS, /* nl-packet: flags */
|
|
|
|
UI_EXTENDED_SIZE /* Everything. */
|
|
|
|
};
|
|
|
|
|
|
|
|
enum drbd_timeout_flag {
|
|
|
|
UT_DEFAULT = 0,
|
|
|
|
UT_DEGRADED = 1,
|
|
|
|
UT_PEER_OUTDATED = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
#define UUID_JUST_CREATED ((__u64)4)
|
|
|
|
|
drbd: on attach, enforce clean meta data
Detection of unclean shutdown has moved into user space.
The kernel code will, whenever it updates the meta data, mark it as
"unclean", and will refuse to attach to such unclean meta data.
"drbdadm up" now schedules "drbdmeta apply-al", which will apply
the activity log to the bitmap, and/or reinitialize it, if necessary,
as well as set a "clean" indicator flag.
This moves a bit code out of kernel space.
As a side effect, it also prevents some 8.3 module from accidentally
ignoring the 8.4 style activity log, if someone should downgrade,
whether on purpose, or accidentally because he changed kernel versions
without providing an 8.4 for the new kernel, and the new kernel comes
with in-tree 8.3.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2011-07-06 02:59:26 +08:00
|
|
|
/* magic numbers used in meta data and network packets */
|
2009-09-26 07:07:19 +08:00
|
|
|
#define DRBD_MAGIC 0x83740267
|
2010-08-20 19:36:10 +08:00
|
|
|
#define DRBD_MAGIC_BIG 0x835a
|
2011-03-30 22:00:17 +08:00
|
|
|
#define DRBD_MAGIC_100 0x8620ec20
|
2009-09-26 07:07:19 +08:00
|
|
|
|
drbd: on attach, enforce clean meta data
Detection of unclean shutdown has moved into user space.
The kernel code will, whenever it updates the meta data, mark it as
"unclean", and will refuse to attach to such unclean meta data.
"drbdadm up" now schedules "drbdmeta apply-al", which will apply
the activity log to the bitmap, and/or reinitialize it, if necessary,
as well as set a "clean" indicator flag.
This moves a bit code out of kernel space.
As a side effect, it also prevents some 8.3 module from accidentally
ignoring the 8.4 style activity log, if someone should downgrade,
whether on purpose, or accidentally because he changed kernel versions
without providing an 8.4 for the new kernel, and the new kernel comes
with in-tree 8.3.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2011-07-06 02:59:26 +08:00
|
|
|
#define DRBD_MD_MAGIC_07 (DRBD_MAGIC+3)
|
|
|
|
#define DRBD_MD_MAGIC_08 (DRBD_MAGIC+4)
|
|
|
|
#define DRBD_MD_MAGIC_84_UNCLEAN (DRBD_MAGIC+5)
|
|
|
|
|
|
|
|
|
2011-02-21 20:21:03 +08:00
|
|
|
/* how I came up with this magic?
|
|
|
|
* base64 decode "actlog==" ;) */
|
|
|
|
#define DRBD_AL_MAGIC 0x69cb65a2
|
|
|
|
|
2009-09-26 07:07:19 +08:00
|
|
|
/* these are of type "int" */
|
|
|
|
#define DRBD_MD_INDEX_INTERNAL -1
|
|
|
|
#define DRBD_MD_INDEX_FLEX_EXT -2
|
|
|
|
#define DRBD_MD_INDEX_FLEX_INT -3
|
|
|
|
|
2011-07-22 19:53:19 +08:00
|
|
|
#define DRBD_CPU_MASK_SIZE 32
|
|
|
|
|
2009-09-26 07:07:19 +08:00
|
|
|
#endif
|