sysfile.c (c1f3ee120bb61045b1c0a3ead620d1d65af47130) sysfile.c (cb25797d451dc774d9dbc402a65f16a0e32199fe)
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * sysfile.c
5 *
6 * Initialize, read, write, etc. system files.
7 *
8 * Copyright (C) 2002, 2004 Oracle. All rights reserved.

--- 36 unchanged lines hidden (view full) ---

45 int type,
46 u32 slot);
47
48static inline int is_global_system_inode(int type);
49static inline int is_in_system_inode_array(struct ocfs2_super *osb,
50 int type,
51 u32 slot);
52
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * sysfile.c
5 *
6 * Initialize, read, write, etc. system files.
7 *
8 * Copyright (C) 2002, 2004 Oracle. All rights reserved.

--- 36 unchanged lines hidden (view full) ---

45 int type,
46 u32 slot);
47
48static inline int is_global_system_inode(int type);
49static inline int is_in_system_inode_array(struct ocfs2_super *osb,
50 int type,
51 u32 slot);
52
53static struct lock_class_key ocfs2_sysfile_cluster_lock_key[NUM_SYSTEM_INODES];
54
53static inline int is_global_system_inode(int type)
54{
55 return type >= OCFS2_FIRST_ONLINE_SYSTEM_INODE &&
56 type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE;
57}
58
59static inline int is_in_system_inode_array(struct ocfs2_super *osb,
60 int type,

--- 52 unchanged lines hidden (view full) ---

113 }
114
115 inode = ocfs2_iget(osb, blkno, OCFS2_FI_FLAG_SYSFILE, type);
116 if (IS_ERR(inode)) {
117 mlog_errno(PTR_ERR(inode));
118 inode = NULL;
119 goto bail;
120 }
55static inline int is_global_system_inode(int type)
56{
57 return type >= OCFS2_FIRST_ONLINE_SYSTEM_INODE &&
58 type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE;
59}
60
61static inline int is_in_system_inode_array(struct ocfs2_super *osb,
62 int type,

--- 52 unchanged lines hidden (view full) ---

115 }
116
117 inode = ocfs2_iget(osb, blkno, OCFS2_FI_FLAG_SYSFILE, type);
118 if (IS_ERR(inode)) {
119 mlog_errno(PTR_ERR(inode));
120 inode = NULL;
121 goto bail;
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:
122
123 return inode;
124}
125
138bail:
139
140 return inode;
141}
142