aboutsummaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
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);