aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/sysfile.c
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/sysfile.c
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/sysfile.c')
-rw-r--r--fs/ocfs2/sysfile.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/ocfs2/sysfile.c b/fs/ocfs2/sysfile.c
index ab713ebdd546..6f53f5e7256a 100644
--- a/fs/ocfs2/sysfile.c
+++ b/fs/ocfs2/sysfile.c
@@ -50,6 +50,8 @@ static inline int is_in_system_inode_array(struct ocfs2_super *osb,
50 int type, 50 int type,
51 u32 slot); 51 u32 slot);
52 52
53static struct lock_class_key ocfs2_sysfile_cluster_lock_key[NUM_SYSTEM_INODES];
54
53static inline int is_global_system_inode(int type) 55static inline int is_global_system_inode(int type)
54{ 56{
55 return type >= OCFS2_FIRST_ONLINE_SYSTEM_INODE && 57 return type >= OCFS2_FIRST_ONLINE_SYSTEM_INODE &&
@@ -118,6 +120,21 @@ static struct inode * _ocfs2_get_system_file_inode(struct ocfs2_super *osb,
118 inode = NULL; 120 inode = NULL;
119 goto bail; 121 goto bail;
120 } 122 }
123#ifdef CONFIG_DEBUG_LOCK_ALLOC
124 if (type == LOCAL_USER_QUOTA_SYSTEM_INODE ||
125 type == LOCAL_GROUP_QUOTA_SYSTEM_INODE ||
126 type == JOURNAL_SYSTEM_INODE) {
127 /* Ignore inode lock on these inodes as the lock does not
128 * really belong to any process and lockdep cannot handle
129 * that */
130 OCFS2_I(inode)->ip_inode_lockres.l_lockdep_map.key = NULL;
131 } else {
132 lockdep_init_map(&OCFS2_I(inode)->ip_inode_lockres.
133 l_lockdep_map,
134 ocfs2_system_inodes[type].si_name,
135 &ocfs2_sysfile_cluster_lock_key[type], 0);
136 }
137#endif
121bail: 138bail:
122 139
123 return inode; 140 return inode;