mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
fd1782b5fc
This adds the infrastructure, code paths, error reporting, etc. to handle storage errors, or storage loss, under the sanlock leases in a VG that is being used. The loss of storage means sanlock cannot renew its leases, which means that the host needs to stop using the shared VG before its leases expire. This still requires manually shutting down a VG that has lost lease storage, e.g. unmounting file systems, deactivating LVs in the VG. The next step is to automatically use a command like blkdeactivate to do that.
52 lines
1.2 KiB
C
52 lines
1.2 KiB
C
/*
|
|
* Copyright (C) 2014-2015 Red Hat, Inc.
|
|
*
|
|
* This file is part of LVM2.
|
|
*
|
|
* This copyrighted material is made available to anyone wishing to use,
|
|
* modify, copy, or redistribute it subject to the terms and conditions
|
|
* of the GNU Lesser General Public License v.2.1.
|
|
*/
|
|
|
|
#ifndef _LVM_LVMLOCKD_CLIENT_H
|
|
#define _LVM_LVMLOCKD_CLIENT_H
|
|
|
|
#include "daemon-client.h"
|
|
|
|
#define LVMLOCKD_SOCKET DEFAULT_RUN_DIR "/lvmlockd.socket"
|
|
|
|
/* Wrappers to open/close connection */
|
|
|
|
static inline daemon_handle lvmlockd_open(const char *sock)
|
|
{
|
|
daemon_info lvmlockd_info = {
|
|
.path = "lvmlockd",
|
|
.socket = sock ?: LVMLOCKD_SOCKET,
|
|
.protocol = "lvmlockd",
|
|
.protocol_version = 1,
|
|
.autostart = 0
|
|
};
|
|
|
|
return daemon_open(lvmlockd_info);
|
|
}
|
|
|
|
static inline void lvmlockd_close(daemon_handle h)
|
|
{
|
|
return daemon_close(h);
|
|
}
|
|
|
|
/*
|
|
* Errors returned as the lvmlockd result value.
|
|
*/
|
|
#define ENOLS 210 /* lockspace not found */
|
|
#define ESTARTING 211 /* lockspace is starting */
|
|
#define EARGS 212
|
|
#define EHOSTID 213
|
|
#define EMANAGER 214
|
|
#define EPREPARE 215
|
|
#define ELOCKD 216
|
|
#define EVGKILLED 217 /* sanlock lost access to leases and VG is killed. */
|
|
#define ELOCKIO 218 /* sanlock io errors during lock op, may be transient. */
|
|
|
|
#endif /* _LVM_LVMLOCKD_CLIENT_H */
|