Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /******************************************************************************
0003 *******************************************************************************
0004 **
0005 **  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
0006 **  Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
0007 **
0008 **  This copyrighted material is made available to anyone wishing to use,
0009 **  modify, copy, or redistribute it subject to the terms and conditions
0010 **  of the GNU General Public License v.2.
0011 **
0012 *******************************************************************************
0013 ******************************************************************************/
0014 
0015 #ifndef _LINUX_DLM_DEVICE_H
0016 #define _LINUX_DLM_DEVICE_H
0017 
0018 /* This is the device interface for dlm, most users will use a library
0019  * interface.
0020  */
0021 
0022 #include <linux/dlm.h>
0023 #include <linux/types.h>
0024 
0025 #define DLM_USER_LVB_LEN    32
0026 
0027 /* Version of the device interface */
0028 #define DLM_DEVICE_VERSION_MAJOR 6
0029 #define DLM_DEVICE_VERSION_MINOR 0
0030 #define DLM_DEVICE_VERSION_PATCH 2
0031 
0032 /* struct passed to the lock write */
0033 struct dlm_lock_params {
0034     __u8 mode;
0035     __u8 namelen;
0036     __u16 unused;
0037     __u32 flags;
0038     __u32 lkid;
0039     __u32 parent;
0040     __u64 xid;
0041     __u64 timeout;
0042     void __user *castparam;
0043     void __user *castaddr;
0044     void __user *bastparam;
0045     void __user *bastaddr;
0046     struct dlm_lksb __user *lksb;
0047     char lvb[DLM_USER_LVB_LEN];
0048     char name[];
0049 };
0050 
0051 struct dlm_lspace_params {
0052     __u32 flags;
0053     __u32 minor;
0054     char name[];
0055 };
0056 
0057 struct dlm_purge_params {
0058     __u32 nodeid;
0059     __u32 pid;
0060 };
0061 
0062 struct dlm_write_request {
0063     __u32 version[3];
0064     __u8 cmd;
0065     __u8 is64bit;
0066     __u8 unused[2];
0067 
0068     union  {
0069         struct dlm_lock_params   lock;
0070         struct dlm_lspace_params lspace;
0071         struct dlm_purge_params  purge;
0072     } i;
0073 };
0074 
0075 struct dlm_device_version {
0076     __u32 version[3];
0077 };
0078 
0079 /* struct read from the "device" fd,
0080    consists mainly of userspace pointers for the library to use */
0081 
0082 struct dlm_lock_result {
0083     __u32 version[3];
0084     __u32 length;
0085     void __user * user_astaddr;
0086     void __user * user_astparam;
0087     struct dlm_lksb __user * user_lksb;
0088     struct dlm_lksb lksb;
0089     __u8 bast_mode;
0090     __u8 unused[3];
0091     /* Offsets may be zero if no data is present */
0092     __u32 lvb_offset;
0093 };
0094 
0095 /* Commands passed to the device */
0096 #define DLM_USER_LOCK         1
0097 #define DLM_USER_UNLOCK       2
0098 #define DLM_USER_QUERY        3
0099 #define DLM_USER_CREATE_LOCKSPACE  4
0100 #define DLM_USER_REMOVE_LOCKSPACE  5
0101 #define DLM_USER_PURGE        6
0102 #define DLM_USER_DEADLOCK     7
0103 
0104 /* Lockspace flags */
0105 #define DLM_USER_LSFLG_AUTOFREE   1
0106 #define DLM_USER_LSFLG_FORCEFREE  2
0107 
0108 #endif
0109