/usr/include/sanlock.h is in libsanlock-dev 2.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | /*
* Copyright 2010-2011 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*/
#ifndef __SANLOCK_H__
#define __SANLOCK_H__
/* pid can own this many resources at once */
#define SANLK_MAX_RESOURCES 8
/* max resource name length */
#define SANLK_NAME_LEN 48
/* max disk path length, includes terminating \0 byte */
#define SANLK_PATH_LEN 1024
/* max disks in a single lease */
#define SANLK_MAX_DISKS 4
/*
* max length of a sanlk_resource in string format
* <lockspace_name>:<resource_name>:<path>:<offset>[:<path>:<offset>...]:<lver>
* 48 SANLK_NAME_LEN
* + 1 colon
* + 48 SANLK_NAME_LEN
* + 1 colon
* + 4184 (4 MAX_DISKS * (1024 SANLK_PATH_LEN + 1 colon + 20 offset + 1 colon))
* + 20 lver
* ------
* 4302
*/
#define SANLK_MAX_RES_STR 4400
/* TODO: add more padding to sanlk_disk so we can extend sync_disk
later without changing abi */
struct sanlk_disk {
char path[SANLK_PATH_LEN]; /* must include terminating \0 */
uint64_t offset;
uint32_t pad1;
uint32_t pad2;
};
#define SANLK_RES_LVER 0x1 /* lver field is set */
#define SANLK_RES_NUM_HOSTS 0x2 /* data32 field is new num_hosts */
#define SANLK_RES_SHARED 0x4
struct sanlk_resource {
char lockspace_name[SANLK_NAME_LEN]; /* terminating \0 not required */
char name[SANLK_NAME_LEN]; /* terminating \0 not required */
uint64_t lver; /* use with SANLK_RES_LVER */
uint64_t data64; /* per-resource command-specific data */
uint32_t data32; /* per-resource command-specific data */
uint32_t unused;
uint32_t flags; /* SANLK_RES_ */
uint32_t num_disks;
/* followed by num_disks sanlk_disk structs */
struct sanlk_disk disks[0];
};
/* command-specific command options (can include per resource data, but
that requires the extra work of segmenting it by resource name) */
struct sanlk_options {
char owner_name[SANLK_NAME_LEN]; /* optional user friendly name */
uint32_t flags;
uint32_t len;
/* followed by len bytes (migration input will use this) */
char str[0];
};
struct sanlk_lockspace {
char name[SANLK_NAME_LEN];
uint64_t host_id;
uint32_t flags;
struct sanlk_disk host_id_disk;
};
#endif
|