aboutsummaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
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 /mm/shmem.c
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 'mm/shmem.c')
-rw-r--r--mm/shmem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index a1f2f02af724..343b3c0937e5 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1370,7 +1370,7 @@ shmem_file_write(struct file *file, const char __user *buf, size_t count, loff_t
1370 if (!access_ok(VERIFY_READ, buf, count)) 1370 if (!access_ok(VERIFY_READ, buf, count))
1371 return -EFAULT; 1371 return -EFAULT;
1372 1372
1373 down(&inode->i_sem); 1373 mutex_lock(&inode->i_mutex);
1374 1374
1375 pos = *ppos; 1375 pos = *ppos;
1376 written = 0; 1376 written = 0;
@@ -1455,7 +1455,7 @@ shmem_file_write(struct file *file, const char __user *buf, size_t count, loff_t
1455 if (written) 1455 if (written)
1456 err = written; 1456 err = written;
1457out: 1457out:
1458 up(&inode->i_sem); 1458 mutex_unlock(&inode->i_mutex);
1459 return err; 1459 return err;
1460} 1460}
1461 1461
@@ -1491,7 +1491,7 @@ static void do_shmem_file_read(struct file *filp, loff_t *ppos, read_descriptor_
1491 1491
1492 /* 1492 /*
1493 * We must evaluate after, since reads (unlike writes) 1493 * We must evaluate after, since reads (unlike writes)
1494 * are called without i_sem protection against truncate 1494 * are called without i_mutex protection against truncate
1495 */ 1495 */
1496 nr = PAGE_CACHE_SIZE; 1496 nr = PAGE_CACHE_SIZE;
1497 i_size = i_size_read(inode); 1497 i_size = i_size_read(inode);