2015-03-05 23:00:44 +03:00
/*
2015-07-03 18:34:40 +03:00
* Copyright ( C ) 2014 - 2015 Red Hat , Inc .
2015-03-05 23:00:44 +03:00
*
* 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
2018-05-14 12:30:20 +03:00
# include "libdaemon/client/daemon-client.h"
2015-03-05 23:00:44 +03:00
# define LVMLOCKD_SOCKET DEFAULT_RUN_DIR " / lvmlockd.socket"
2020-05-04 21:35:03 +03:00
# define LVMLOCKD_ADOPT_FILE DEFAULT_RUN_DIR " / lvmlockd.adopt"
2015-03-05 23:00:44 +03:00
/* Wrappers to open/close connection */
2024-04-09 17:43:38 +03:00
static inline __attribute__ ( ( always_inline ) )
daemon_handle lvmlockd_open ( const char * sock )
2015-03-05 23:00:44 +03:00
{
daemon_info lvmlockd_info = {
. path = " lvmlockd " ,
. socket = sock ? : LVMLOCKD_SOCKET ,
2020-08-29 22:37:39 +03:00
. autostart = 0 ,
2015-03-05 23:00:44 +03:00
. protocol = " lvmlockd " ,
. protocol_version = 1 ,
} ;
return daemon_open ( lvmlockd_info ) ;
}
static inline void lvmlockd_close ( daemon_handle h )
{
2020-08-28 20:33:49 +03:00
daemon_close ( h ) ;
2015-03-05 23:00:44 +03:00
}
/*
* 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
2015-07-31 21:38:38 +03:00
# define EVGKILLED 217 /* sanlock lost access to leases and VG is killed. */
# define ELOCKIO 218 /* sanlock io errors during lock op, may be transient. */
2015-08-26 18:01:05 +03:00
# define EREMOVED 219
2017-10-17 21:45:53 +03:00
# define EDEVOPEN 220 /* sanlock failed to open lvmlock LV */
2017-11-16 01:00:41 +03:00
# define ELMERR 221
2015-03-05 23:00:44 +03:00
2015-07-03 18:34:40 +03:00
# endif /* _LVM_LVMLOCKD_CLIENT_H */