aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2006-01-09 18:59:24 -0500
committerIngo Molnar <mingo@hera.kernel.org>2006-01-09 18:59:24 -0500
commit1b1dcc1b57a49136f118a0f16367256ff9994a69 (patch)
treeb0b36d4f41d28c9d6514fb309d33c1a084d6309b /fs/ext2
parent794ee1baee1c26be40410233e6c20bceb2b03c08 (diff)
[PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem
This patch converts the inode semaphore to a mutex. I have tested it on XFS and compiled as much as one can consider on an ia64. Anyway your luck with it might be different. Modified-by: Ingo Molnar <mingo@elte.hu> (finished the conversion) Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/ext2')
-rw-r--r--fs/ext2/acl.c10
-rw-r--r--fs/ext2/ext2.h2
-rw-r--r--fs/ext2/super.c4
-rw-r--r--fs/ext2/xattr.c2
4 files changed, 9 insertions, 9 deletions
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c
index 6af2f4130290..239133d01d91 100644
--- a/fs/ext2/acl.c
+++ b/fs/ext2/acl.c
@@ -149,7 +149,7 @@ ext2_iset_acl(struct inode *inode, struct posix_acl **i_acl,
149} 149}
150 150
151/* 151/*
152 * inode->i_sem: don't care 152 * inode->i_mutex: don't care
153 */ 153 */
154static struct posix_acl * 154static struct posix_acl *
155ext2_get_acl(struct inode *inode, int type) 155ext2_get_acl(struct inode *inode, int type)
@@ -211,7 +211,7 @@ ext2_get_acl(struct inode *inode, int type)
211} 211}
212 212
213/* 213/*
214 * inode->i_sem: down 214 * inode->i_mutex: down
215 */ 215 */
216static int 216static int
217ext2_set_acl(struct inode *inode, int type, struct posix_acl *acl) 217ext2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
@@ -301,8 +301,8 @@ ext2_permission(struct inode *inode, int mask, struct nameidata *nd)
301/* 301/*
302 * Initialize the ACLs of a new inode. Called from ext2_new_inode. 302 * Initialize the ACLs of a new inode. Called from ext2_new_inode.
303 * 303 *
304 * dir->i_sem: down 304 * dir->i_mutex: down
305 * inode->i_sem: up (access to inode is still exclusive) 305 * inode->i_mutex: up (access to inode is still exclusive)
306 */ 306 */
307int 307int
308ext2_init_acl(struct inode *inode, struct inode *dir) 308ext2_init_acl(struct inode *inode, struct inode *dir)
@@ -361,7 +361,7 @@ cleanup:
361 * for directories) are added. There are no more bits available in the 361 * for directories) are added. There are no more bits available in the
362 * file mode. 362 * file mode.
363 * 363 *
364 * inode->i_sem: down 364 * inode->i_mutex: down
365 */ 365 */
366int 366int
367ext2_acl_chmod(struct inode *inode) 367ext2_acl_chmod(struct inode *inode)
diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
index e977f8566d14..00de0a7312a2 100644
--- a/fs/ext2/ext2.h
+++ b/fs/ext2/ext2.h
@@ -53,7 +53,7 @@ struct ext2_inode_info {
53#ifdef CONFIG_EXT2_FS_XATTR 53#ifdef CONFIG_EXT2_FS_XATTR
54 /* 54 /*
55 * Extended attributes can be read independently of the main file 55 * Extended attributes can be read independently of the main file
56 * data. Taking i_sem even when reading would cause contention 56 * data. Taking i_mutex even when reading would cause contention
57 * between readers of EAs and writers of regular file data, so 57 * between readers of EAs and writers of regular file data, so
58 * instead we synchronize on xattr_sem when reading or changing 58 * instead we synchronize on xattr_sem when reading or changing
59 * EAs. 59 * EAs.
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 522fa70dd8ea..8d6819846fc9 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -1152,7 +1152,7 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
1152 struct buffer_head tmp_bh; 1152 struct buffer_head tmp_bh;
1153 struct buffer_head *bh; 1153 struct buffer_head *bh;
1154 1154
1155 down(&inode->i_sem); 1155 mutex_lock(&inode->i_mutex);
1156 while (towrite > 0) { 1156 while (towrite > 0) {
1157 tocopy = sb->s_blocksize - offset < towrite ? 1157 tocopy = sb->s_blocksize - offset < towrite ?
1158 sb->s_blocksize - offset : towrite; 1158 sb->s_blocksize - offset : towrite;
@@ -1189,7 +1189,7 @@ out:
1189 inode->i_version++; 1189 inode->i_version++;
1190 inode->i_mtime = inode->i_ctime = CURRENT_TIME; 1190 inode->i_mtime = inode->i_ctime = CURRENT_TIME;
1191 mark_inode_dirty(inode); 1191 mark_inode_dirty(inode);
1192 up(&inode->i_sem); 1192 mutex_unlock(&inode->i_mutex);
1193 return len - towrite; 1193 return len - towrite;
1194} 1194}
1195 1195
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 0099462d4271..f7a3b5fee274 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -325,7 +325,7 @@ cleanup:
325/* 325/*
326 * Inode operation listxattr() 326 * Inode operation listxattr()
327 * 327 *
328 * dentry->d_inode->i_sem: don't care 328 * dentry->d_inode->i_mutex: don't care
329 */ 329 */
330ssize_t 330ssize_t
331ext2_listxattr(struct dentry *dentry, char *buffer, size_t size) 331ext2_listxattr(struct dentry *dentry, char *buffer, size_t size)