mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
locking: add locking_supports_remote_queries
Add function to detect whether locking could be used to query for lock type so we could recognize exclusive activation.
This commit is contained in:
parent
9d57aa9a0f
commit
f90bc22ca5
@ -611,7 +611,7 @@ int init_cluster_locking(struct locking_type *locking, struct cmd_context *cmd,
|
||||
locking->query_resource = _query_resource;
|
||||
locking->fin_locking = _locking_end;
|
||||
locking->reset_locking = _reset_locking;
|
||||
locking->flags = LCK_PRE_MEMLOCK | LCK_CLUSTERED;
|
||||
locking->flags = LCK_PRE_MEMLOCK | LCK_CLUSTERED | LCK_SUPPORTS_REMOTE_QUERIES;
|
||||
|
||||
_clvmd_sock = _open_local_sock(suppress_messages);
|
||||
if (_clvmd_sock == -1)
|
||||
|
@ -492,6 +492,11 @@ int locking_is_clustered(void)
|
||||
return (_locking.flags & LCK_CLUSTERED) ? 1 : 0;
|
||||
}
|
||||
|
||||
int locking_supports_remote_queries(void)
|
||||
{
|
||||
return (_locking.flags & LCK_SUPPORTS_REMOTE_QUERIES) ? 1 : 0;
|
||||
}
|
||||
|
||||
int remote_lock_held(const char *vol, int *exclusive)
|
||||
{
|
||||
int mode = LCK_NULL;
|
||||
|
@ -26,6 +26,7 @@ void fin_locking(void);
|
||||
void reset_locking(void);
|
||||
int vg_write_lock_held(void);
|
||||
int locking_is_clustered(void);
|
||||
int locking_supports_remote_queries(void);
|
||||
|
||||
int remote_lock_held(const char *vol, int *exclusive);
|
||||
|
||||
|
@ -25,6 +25,7 @@ typedef void (*reset_lock_fn) (void);
|
||||
|
||||
#define LCK_PRE_MEMLOCK 0x00000001 /* Is memlock() needed before calls? */
|
||||
#define LCK_CLUSTERED 0x00000002
|
||||
#define LCK_SUPPORTS_REMOTE_QUERIES 0x00000004
|
||||
|
||||
struct locking_type {
|
||||
uint32_t flags;
|
||||
|
Loading…
Reference in New Issue
Block a user