[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>
This commit is contained in:

committed by
Ingo Molnar

parent
794ee1baee
commit
1b1dcc1b57
@@ -338,7 +338,7 @@ __xip_file_write(struct file *filp, const char __user *buf,
|
||||
*ppos = pos;
|
||||
/*
|
||||
* No need to use i_size_read() here, the i_size
|
||||
* cannot change under us because we hold i_sem.
|
||||
* cannot change under us because we hold i_mutex.
|
||||
*/
|
||||
if (pos > inode->i_size) {
|
||||
i_size_write(inode, pos);
|
||||
@@ -358,7 +358,7 @@ xip_file_write(struct file *filp, const char __user *buf, size_t len,
|
||||
loff_t pos;
|
||||
ssize_t ret;
|
||||
|
||||
down(&inode->i_sem);
|
||||
mutex_lock(&inode->i_mutex);
|
||||
|
||||
if (!access_ok(VERIFY_READ, buf, len)) {
|
||||
ret=-EFAULT;
|
||||
@@ -390,7 +390,7 @@ xip_file_write(struct file *filp, const char __user *buf, size_t len,
|
||||
out_backing:
|
||||
current->backing_dev_info = NULL;
|
||||
out_up:
|
||||
up(&inode->i_sem);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xip_file_write);
|
||||
|
Reference in New Issue
Block a user