2
* Copyright 2010-2011 Red Hat, Inc.
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
13
/* pid can own this many resources at once */
15
#define SANLK_MAX_RESOURCES 8
17
/* max resource name length */
19
#define SANLK_NAME_LEN 48
21
/* max disk path length, includes terminating \0 byte */
23
#define SANLK_PATH_LEN 1024
25
/* max disks in a single lease */
27
#define SANLK_MAX_DISKS 4
30
* max length of a sanlk_resource in string format
31
* <lockspace_name>:<resource_name>:<path>:<offset>[:<path>:<offset>...]:<lver>
36
* + 4184 (4 MAX_DISKS * (1024 SANLK_PATH_LEN + 1 colon + 20 offset + 1 colon))
42
#define SANLK_MAX_RES_STR 4400
44
/* TODO: add more padding to sanlk_disk so we can extend sync_disk
45
later without changing abi */
48
char path[SANLK_PATH_LEN]; /* must include terminating \0 */
54
#define SANLK_RES_LVER 0x1 /* lver field is set */
55
#define SANLK_RES_NUM_HOSTS 0x2 /* data32 field is new num_hosts */
57
struct sanlk_resource {
58
char lockspace_name[SANLK_NAME_LEN]; /* terminating \0 not required */
59
char name[SANLK_NAME_LEN]; /* terminating \0 not required */
60
uint64_t lver; /* use with SANLK_RES_LVER */
61
uint64_t data64; /* per-resource command-specific data */
62
uint32_t data32; /* per-resource command-specific data */
66
/* followed by num_disks sanlk_disk structs */
67
struct sanlk_disk disks[0];
70
/* command-specific command options (can include per resource data, but
71
that requires the extra work of segmenting it by resource name) */
73
struct sanlk_options {
74
char owner_name[SANLK_NAME_LEN]; /* optional user friendly name */
77
/* followed by len bytes (migration input will use this) */
81
struct sanlk_lockspace {
82
char name[SANLK_NAME_LEN];
85
struct sanlk_disk host_id_disk;