blob: 647c8ef2722795bdc8bd4f4074799ab80e0a02b2 [file] [log] [blame]
David Teigland3ae1acf2007-05-18 08:59:31 -05001/*
2 * Copyright (C) 2007 Red Hat, Inc. All rights reserved.
3 *
4 * This copyrighted material is made available to anyone wishing to use,
5 * modify, copy, or redistribute it subject to the terms and conditions
6 * of the GNU General Public License v.2.
7 */
8
9#ifndef _DLM_NETLINK_H
10#define _DLM_NETLINK_H
11
Arnd Bergmann9adfbfb2009-02-26 00:51:40 +010012#include <linux/types.h>
13
David Teigland3ae1acf2007-05-18 08:59:31 -050014enum {
15 DLM_STATUS_WAITING = 1,
16 DLM_STATUS_GRANTED = 2,
17 DLM_STATUS_CONVERT = 3,
18};
19
20#define DLM_LOCK_DATA_VERSION 1
21
22struct dlm_lock_data {
Arnd Bergmann9adfbfb2009-02-26 00:51:40 +010023 __u16 version;
24 __u32 lockspace_id;
David Teigland3ae1acf2007-05-18 08:59:31 -050025 int nodeid;
26 int ownpid;
Arnd Bergmann9adfbfb2009-02-26 00:51:40 +010027 __u32 id;
28 __u32 remid;
29 __u64 xid;
30 __s8 status;
31 __s8 grmode;
32 __s8 rqmode;
David Teigland3ae1acf2007-05-18 08:59:31 -050033 unsigned long timestamp;
34 int resource_namelen;
35 char resource_name[DLM_RESNAME_MAXLEN];
36};
37
38enum {
39 DLM_CMD_UNSPEC = 0,
40 DLM_CMD_HELLO, /* user->kernel */
41 DLM_CMD_TIMEOUT, /* kernel->user */
42 __DLM_CMD_MAX,
43};
44
45#define DLM_CMD_MAX (__DLM_CMD_MAX - 1)
46
47enum {
48 DLM_TYPE_UNSPEC = 0,
49 DLM_TYPE_LOCK,
50 __DLM_TYPE_MAX,
51};
52
53#define DLM_TYPE_MAX (__DLM_TYPE_MAX - 1)
54
55#define DLM_GENL_VERSION 0x1
56#define DLM_GENL_NAME "DLM"
57
58#endif /* _DLM_NETLINK_H */