~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/ocfs2/dlmfs/userdlm.h

Version: ~ [ linux-5.2 ] ~ [ linux-5.1.16 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.57 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.132 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.184 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.184 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.69 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* -*- mode: c; c-basic-offset: 8; -*-
  2  * vim: noexpandtab sw=8 ts=8 sts=0:
  3  *
  4  * userdlm.h
  5  *
  6  * Userspace dlm defines
  7  *
  8  * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
  9  *
 10  * This program is free software; you can redistribute it and/or
 11  * modify it under the terms of the GNU General Public
 12  * License as published by the Free Software Foundation; either
 13  * version 2 of the License, or (at your option) any later version.
 14  *
 15  * This program is distributed in the hope that it will be useful,
 16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 18  * General Public License for more details.
 19  *
 20  * You should have received a copy of the GNU General Public
 21  * License along with this program; if not, write to the
 22  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 23  * Boston, MA 021110-1307, USA.
 24  */
 25 
 26 
 27 #ifndef USERDLM_H
 28 #define USERDLM_H
 29 
 30 #include <linux/module.h>
 31 #include <linux/fs.h>
 32 #include <linux/types.h>
 33 #include <linux/workqueue.h>
 34 
 35 /* user_lock_res->l_flags flags. */
 36 #define USER_LOCK_ATTACHED      (0x00000001) /* we have initialized
 37                                                * the lvb */
 38 #define USER_LOCK_BUSY          (0x00000002) /* we are currently in
 39                                                * dlm_lock */
 40 #define USER_LOCK_BLOCKED       (0x00000004) /* blocked waiting to
 41                                               * downconvert*/
 42 #define USER_LOCK_IN_TEARDOWN   (0x00000008) /* we're currently
 43                                               * destroying this
 44                                               * lock. */
 45 #define USER_LOCK_QUEUED        (0x00000010) /* lock is on the
 46                                               * workqueue */
 47 #define USER_LOCK_IN_CANCEL     (0x00000020)
 48 
 49 struct user_lock_res {
 50         spinlock_t               l_lock;
 51 
 52         int                      l_flags;
 53 
 54 #define USER_DLM_LOCK_ID_MAX_LEN  32
 55         char                     l_name[USER_DLM_LOCK_ID_MAX_LEN];
 56         int                      l_namelen;
 57         int                      l_level;
 58         unsigned int             l_ro_holders;
 59         unsigned int             l_ex_holders;
 60         struct ocfs2_dlm_lksb    l_lksb;
 61 
 62         int                      l_requested;
 63         int                      l_blocking;
 64 
 65         wait_queue_head_t        l_event;
 66 
 67         struct work_struct       l_work;
 68 };
 69 
 70 extern struct workqueue_struct *user_dlm_worker;
 71 
 72 void user_dlm_lock_res_init(struct user_lock_res *lockres,
 73                             struct dentry *dentry);
 74 int user_dlm_destroy_lock(struct user_lock_res *lockres);
 75 int user_dlm_cluster_lock(struct user_lock_res *lockres,
 76                           int level,
 77                           int lkm_flags);
 78 void user_dlm_cluster_unlock(struct user_lock_res *lockres,
 79                              int level);
 80 void user_dlm_write_lvb(struct inode *inode,
 81                         const char *val,
 82                         unsigned int len);
 83 ssize_t user_dlm_read_lvb(struct inode *inode,
 84                           char *val,
 85                           unsigned int len);
 86 struct ocfs2_cluster_connection *user_dlm_register(struct qstr *name);
 87 void user_dlm_unregister(struct ocfs2_cluster_connection *conn);
 88 void user_dlm_set_locking_protocol(void);
 89 
 90 struct dlmfs_inode_private {
 91         struct ocfs2_cluster_connection *ip_conn;
 92 
 93         struct user_lock_res ip_lockres; /* unused for directories. */
 94         struct inode         *ip_parent;
 95 
 96         struct inode         ip_vfs_inode;
 97 };
 98 
 99 static inline struct dlmfs_inode_private *
100 DLMFS_I(struct inode *inode)
101 {
102         return container_of(inode,
103                             struct dlmfs_inode_private,
104                             ip_vfs_inode);
105 }
106 
107 struct dlmfs_filp_private {
108         int                  fp_lock_level;
109 };
110 
111 #define DLMFS_MAGIC     0x76a9f425
112 
113 #endif /* USERDLM_H */
114 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp