2006-01-18 12:30:29 +03:00
|
|
|
/******************************************************************************
|
|
|
|
*******************************************************************************
|
|
|
|
**
|
|
|
|
** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
|
2007-05-18 18:00:32 +04:00
|
|
|
** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
2006-01-18 12:30:29 +03:00
|
|
|
**
|
|
|
|
** 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 General Public License v.2.
|
|
|
|
**
|
|
|
|
*******************************************************************************
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
/* This is the device interface for dlm, most users will use a library
|
|
|
|
* interface.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define DLM_USER_LVB_LEN 32
|
|
|
|
|
|
|
|
/* Version of the device interface */
|
2007-05-18 18:00:32 +04:00
|
|
|
#define DLM_DEVICE_VERSION_MAJOR 6
|
|
|
|
#define DLM_DEVICE_VERSION_MINOR 0
|
2006-01-18 12:30:29 +03:00
|
|
|
#define DLM_DEVICE_VERSION_PATCH 0
|
|
|
|
|
|
|
|
/* struct passed to the lock write */
|
|
|
|
struct dlm_lock_params {
|
|
|
|
__u8 mode;
|
2006-06-10 00:14:20 +04:00
|
|
|
__u8 namelen;
|
2007-05-18 18:00:32 +04:00
|
|
|
__u16 unused;
|
|
|
|
__u32 flags;
|
2006-01-18 12:30:29 +03:00
|
|
|
__u32 lkid;
|
|
|
|
__u32 parent;
|
2007-05-18 18:00:32 +04:00
|
|
|
__u64 xid;
|
|
|
|
__u64 timeout;
|
|
|
|
void __user *castparam;
|
2006-01-18 12:30:29 +03:00
|
|
|
void __user *castaddr;
|
|
|
|
void __user *bastparam;
|
2007-05-18 18:00:32 +04:00
|
|
|
void __user *bastaddr;
|
2006-01-18 12:30:29 +03:00
|
|
|
struct dlm_lksb __user *lksb;
|
|
|
|
char lvb[DLM_USER_LVB_LEN];
|
2006-06-10 00:14:20 +04:00
|
|
|
char name[0];
|
2006-01-18 12:30:29 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct dlm_lspace_params {
|
|
|
|
__u32 flags;
|
|
|
|
__u32 minor;
|
2006-06-10 00:14:20 +04:00
|
|
|
char name[0];
|
2006-01-18 12:30:29 +03:00
|
|
|
};
|
|
|
|
|
2007-03-31 00:06:16 +04:00
|
|
|
struct dlm_purge_params {
|
|
|
|
__u32 nodeid;
|
|
|
|
__u32 pid;
|
|
|
|
};
|
|
|
|
|
2006-01-18 12:30:29 +03:00
|
|
|
struct dlm_write_request {
|
|
|
|
__u32 version[3];
|
|
|
|
__u8 cmd;
|
2006-06-10 00:14:20 +04:00
|
|
|
__u8 is64bit;
|
|
|
|
__u8 unused[2];
|
2006-01-18 12:30:29 +03:00
|
|
|
|
|
|
|
union {
|
|
|
|
struct dlm_lock_params lock;
|
|
|
|
struct dlm_lspace_params lspace;
|
2007-03-31 00:06:16 +04:00
|
|
|
struct dlm_purge_params purge;
|
2006-01-18 12:30:29 +03:00
|
|
|
} i;
|
|
|
|
};
|
|
|
|
|
2007-05-18 18:00:32 +04:00
|
|
|
struct dlm_device_version {
|
|
|
|
__u32 version[3];
|
|
|
|
};
|
|
|
|
|
2006-01-18 12:30:29 +03:00
|
|
|
/* struct read from the "device" fd,
|
|
|
|
consists mainly of userspace pointers for the library to use */
|
2007-05-18 18:00:32 +04:00
|
|
|
|
2006-01-18 12:30:29 +03:00
|
|
|
struct dlm_lock_result {
|
2007-05-18 18:00:32 +04:00
|
|
|
__u32 version[3];
|
2006-01-18 12:30:29 +03:00
|
|
|
__u32 length;
|
|
|
|
void __user * user_astaddr;
|
|
|
|
void __user * user_astparam;
|
|
|
|
struct dlm_lksb __user * user_lksb;
|
|
|
|
struct dlm_lksb lksb;
|
|
|
|
__u8 bast_mode;
|
2006-06-10 00:14:20 +04:00
|
|
|
__u8 unused[3];
|
2006-01-18 12:30:29 +03:00
|
|
|
/* Offsets may be zero if no data is present */
|
|
|
|
__u32 lvb_offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Commands passed to the device */
|
|
|
|
#define DLM_USER_LOCK 1
|
|
|
|
#define DLM_USER_UNLOCK 2
|
|
|
|
#define DLM_USER_QUERY 3
|
|
|
|
#define DLM_USER_CREATE_LOCKSPACE 4
|
|
|
|
#define DLM_USER_REMOVE_LOCKSPACE 5
|
2007-03-31 00:06:16 +04:00
|
|
|
#define DLM_USER_PURGE 6
|
2007-05-29 17:46:00 +04:00
|
|
|
#define DLM_USER_DEADLOCK 7
|
2006-01-18 12:30:29 +03:00
|
|
|
|
|
|
|
/* Arbitrary length restriction */
|
|
|
|
#define MAX_LS_NAME_LEN 64
|
|
|
|
|
|
|
|
/* Lockspace flags */
|
|
|
|
#define DLM_USER_LSFLG_AUTOFREE 1
|
|
|
|
#define DLM_USER_LSFLG_FORCEFREE 2
|
|
|
|
|