diff options
Diffstat (limited to 'fs/ocfs2/inode.c')
-rw-r--r-- | fs/ocfs2/inode.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 00cd5b7f3e52..5e19c119183d 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c | |||
@@ -57,8 +57,11 @@ struct ocfs2_find_inode_args | |||
57 | u64 fi_blkno; | 57 | u64 fi_blkno; |
58 | unsigned long fi_ino; | 58 | unsigned long fi_ino; |
59 | unsigned int fi_flags; | 59 | unsigned int fi_flags; |
60 | unsigned int fi_sysfile_type; | ||
60 | }; | 61 | }; |
61 | 62 | ||
63 | static struct lock_class_key ocfs2_sysfile_lock_key[NUM_SYSTEM_INODES]; | ||
64 | |||
62 | static int ocfs2_read_locked_inode(struct inode *inode, | 65 | static int ocfs2_read_locked_inode(struct inode *inode, |
63 | struct ocfs2_find_inode_args *args); | 66 | struct ocfs2_find_inode_args *args); |
64 | static int ocfs2_init_locked_inode(struct inode *inode, void *opaque); | 67 | static int ocfs2_init_locked_inode(struct inode *inode, void *opaque); |
@@ -106,7 +109,8 @@ void ocfs2_get_inode_flags(struct ocfs2_inode_info *oi) | |||
106 | oi->ip_attr |= OCFS2_DIRSYNC_FL; | 109 | oi->ip_attr |= OCFS2_DIRSYNC_FL; |
107 | } | 110 | } |
108 | 111 | ||
109 | struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, int flags) | 112 | struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags, |
113 | int sysfile_type) | ||
110 | { | 114 | { |
111 | struct inode *inode = NULL; | 115 | struct inode *inode = NULL; |
112 | struct super_block *sb = osb->sb; | 116 | struct super_block *sb = osb->sb; |
@@ -126,6 +130,7 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, int flags) | |||
126 | args.fi_blkno = blkno; | 130 | args.fi_blkno = blkno; |
127 | args.fi_flags = flags; | 131 | args.fi_flags = flags; |
128 | args.fi_ino = ino_from_blkno(sb, blkno); | 132 | args.fi_ino = ino_from_blkno(sb, blkno); |
133 | args.fi_sysfile_type = sysfile_type; | ||
129 | 134 | ||
130 | inode = iget5_locked(sb, args.fi_ino, ocfs2_find_actor, | 135 | inode = iget5_locked(sb, args.fi_ino, ocfs2_find_actor, |
131 | ocfs2_init_locked_inode, &args); | 136 | ocfs2_init_locked_inode, &args); |
@@ -200,6 +205,9 @@ static int ocfs2_init_locked_inode(struct inode *inode, void *opaque) | |||
200 | 205 | ||
201 | inode->i_ino = args->fi_ino; | 206 | inode->i_ino = args->fi_ino; |
202 | OCFS2_I(inode)->ip_blkno = args->fi_blkno; | 207 | OCFS2_I(inode)->ip_blkno = args->fi_blkno; |
208 | if (args->fi_sysfile_type != 0) | ||
209 | lockdep_set_class(&inode->i_mutex, | ||
210 | &ocfs2_sysfile_lock_key[args->fi_sysfile_type]); | ||
203 | 211 | ||
204 | mlog_exit(0); | 212 | mlog_exit(0); |
205 | return 0; | 213 | return 0; |