aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlmglue.h
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2009-06-04 09:26:50 -0400
committerJoel Becker <joel.becker@oracle.com>2009-06-22 17:34:26 -0400
commitcb25797d451dc774d9dbc402a65f16a0e32199fe (patch)
tree95957b5ae9a72c3971bd44efadf82a5b06a6e579 /fs/ocfs2/dlmglue.h
parent9a7aa12f3911853a3574d47d567b81a2a5df7208 (diff)
ocfs2: Add lockdep annotations
Add lockdep support to OCFS2. The support also covers all of the cluster locks except for open locks, journal locks, and local quotafile locks. These are special because they are acquired for a node, not for a particular process and lockdep cannot deal with such type of locking. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/dlmglue.h')
-rw-r--r--fs/ocfs2/dlmglue.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/fs/ocfs2/dlmglue.h b/fs/ocfs2/dlmglue.h
index 30f683107f1e..7553836931de 100644
--- a/fs/ocfs2/dlmglue.h
+++ b/fs/ocfs2/dlmglue.h
@@ -78,6 +78,14 @@ struct ocfs2_orphan_scan_lvb {
78/* don't block waiting for the downconvert thread, instead return -EAGAIN */ 78/* don't block waiting for the downconvert thread, instead return -EAGAIN */
79#define OCFS2_LOCK_NONBLOCK (0x04) 79#define OCFS2_LOCK_NONBLOCK (0x04)
80 80
81/* Locking subclasses of inode cluster lock */
82enum {
83 OI_LS_NORMAL = 0,
84 OI_LS_PARENT,
85 OI_LS_RENAME1,
86 OI_LS_RENAME2,
87};
88
81int ocfs2_dlm_init(struct ocfs2_super *osb); 89int ocfs2_dlm_init(struct ocfs2_super *osb);
82void ocfs2_dlm_shutdown(struct ocfs2_super *osb, int hangup_pending); 90void ocfs2_dlm_shutdown(struct ocfs2_super *osb, int hangup_pending);
83void ocfs2_lock_res_init_once(struct ocfs2_lock_res *res); 91void ocfs2_lock_res_init_once(struct ocfs2_lock_res *res);
@@ -104,17 +112,23 @@ void ocfs2_open_unlock(struct inode *inode);
104int ocfs2_inode_lock_atime(struct inode *inode, 112int ocfs2_inode_lock_atime(struct inode *inode,
105 struct vfsmount *vfsmnt, 113 struct vfsmount *vfsmnt,
106 int *level); 114 int *level);
107int ocfs2_inode_lock_full(struct inode *inode, 115int ocfs2_inode_lock_full_nested(struct inode *inode,
108 struct buffer_head **ret_bh, 116 struct buffer_head **ret_bh,
109 int ex, 117 int ex,
110 int arg_flags); 118 int arg_flags,
119 int subclass);
111int ocfs2_inode_lock_with_page(struct inode *inode, 120int ocfs2_inode_lock_with_page(struct inode *inode,
112 struct buffer_head **ret_bh, 121 struct buffer_head **ret_bh,
113 int ex, 122 int ex,
114 struct page *page); 123 struct page *page);
124/* Variants without special locking class or flags */
125#define ocfs2_inode_lock_full(i, r, e, f)\
126 ocfs2_inode_lock_full_nested(i, r, e, f, OI_LS_NORMAL)
127#define ocfs2_inode_lock_nested(i, b, e, s)\
128 ocfs2_inode_lock_full_nested(i, b, e, 0, s)
115/* 99% of the time we don't want to supply any additional flags -- 129/* 99% of the time we don't want to supply any additional flags --
116 * those are for very specific cases only. */ 130 * those are for very specific cases only. */
117#define ocfs2_inode_lock(i, b, e) ocfs2_inode_lock_full(i, b, e, 0) 131#define ocfs2_inode_lock(i, b, e) ocfs2_inode_lock_full_nested(i, b, e, 0, OI_LS_NORMAL)
118void ocfs2_inode_unlock(struct inode *inode, 132void ocfs2_inode_unlock(struct inode *inode,
119 int ex); 133 int ex);
120int ocfs2_super_lock(struct ocfs2_super *osb, 134int ocfs2_super_lock(struct ocfs2_super *osb,