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

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

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * userdlm.h
  4  *
  5  * Userspace dlm defines
  6  *
  7  * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
  8  */
  9 
 10 
 11 #ifndef USERDLM_H
 12 #define USERDLM_H
 13 
 14 #include <linux/module.h>
 15 #include <linux/fs.h>
 16 #include <linux/types.h>
 17 #include <linux/workqueue.h>
 18 
 19 /* user_lock_res->l_flags flags. */
 20 #define USER_LOCK_ATTACHED      (0x00000001) /* we have initialized
 21                                                * the lvb */
 22 #define USER_LOCK_BUSY          (0x00000002) /* we are currently in
 23                                                * dlm_lock */
 24 #define USER_LOCK_BLOCKED       (0x00000004) /* blocked waiting to
 25                                               * downconvert*/
 26 #define USER_LOCK_IN_TEARDOWN   (0x00000008) /* we're currently
 27                                               * destroying this
 28                                               * lock. */
 29 #define USER_LOCK_QUEUED        (0x00000010) /* lock is on the
 30                                               * workqueue */
 31 #define USER_LOCK_IN_CANCEL     (0x00000020)
 32 
 33 struct user_lock_res {
 34         spinlock_t               l_lock;
 35 
 36         int                      l_flags;
 37 
 38 #define USER_DLM_LOCK_ID_MAX_LEN  32
 39         char                     l_name[USER_DLM_LOCK_ID_MAX_LEN];
 40         int                      l_namelen;
 41         int                      l_level;
 42         unsigned int             l_ro_holders;
 43         unsigned int             l_ex_holders;
 44         struct ocfs2_dlm_lksb    l_lksb;
 45 
 46         int                      l_requested;
 47         int                      l_blocking;
 48 
 49         wait_queue_head_t        l_event;
 50 
 51         struct work_struct       l_work;
 52 };
 53 
 54 extern struct workqueue_struct *user_dlm_worker;
 55 
 56 void user_dlm_lock_res_init(struct user_lock_res *lockres,
 57                             struct dentry *dentry);
 58 int user_dlm_destroy_lock(struct user_lock_res *lockres);
 59 int user_dlm_cluster_lock(struct user_lock_res *lockres,
 60                           int level,
 61                           int lkm_flags);
 62 void user_dlm_cluster_unlock(struct user_lock_res *lockres,
 63                              int level);
 64 void user_dlm_write_lvb(struct inode *inode,
 65                         const char *val,
 66                         unsigned int len);
 67 bool user_dlm_read_lvb(struct inode *inode, char *val);
 68 struct ocfs2_cluster_connection *user_dlm_register(const struct qstr *name);
 69 void user_dlm_unregister(struct ocfs2_cluster_connection *conn);
 70 void user_dlm_set_locking_protocol(void);
 71 
 72 struct dlmfs_inode_private {
 73         struct ocfs2_cluster_connection *ip_conn;
 74 
 75         struct user_lock_res ip_lockres; /* unused for directories. */
 76         struct inode         *ip_parent;
 77 
 78         struct inode         ip_vfs_inode;
 79 };
 80 
 81 static inline struct dlmfs_inode_private *
 82 DLMFS_I(struct inode *inode)
 83 {
 84         return container_of(inode,
 85                             struct dlmfs_inode_private,
 86                             ip_vfs_inode);
 87 }
 88 
 89 struct dlmfs_filp_private {
 90         int                  fp_lock_level;
 91 };
 92 
 93 #define DLMFS_MAGIC     0x76a9f425
 94 
 95 #endif /* USERDLM_H */
 96 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php