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

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

Version: ~ [ linux-5.12-rc1 ] ~ [ linux-5.11.2 ] ~ [ linux-5.10.19 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.101 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.177 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.222 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.258 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.258 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

~ [ 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