aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/file.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 /fs/reiserfs/file.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 'fs/reiserfs/file.c')
-rw-r--r--fs/reiserfs/file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index 7892a865b58a..127e7d2cabdd 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -49,7 +49,7 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
49 } 49 }
50 50
51 reiserfs_write_lock(inode->i_sb); 51 reiserfs_write_lock(inode->i_sb);
52 down(&inode->i_sem); 52 mutex_lock(&inode->i_mutex);
53 /* freeing preallocation only involves relogging blocks that 53 /* freeing preallocation only involves relogging blocks that
54 * are already in the current transaction. preallocation gets 54 * are already in the current transaction. preallocation gets
55 * freed at the end of each transaction, so it is impossible for 55 * freed at the end of each transaction, so it is impossible for
@@ -100,7 +100,7 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
100 err = reiserfs_truncate_file(inode, 0); 100 err = reiserfs_truncate_file(inode, 0);
101 } 101 }
102 out: 102 out:
103 up(&inode->i_sem); 103 mutex_unlock(&inode->i_mutex);
104 reiserfs_write_unlock(inode->i_sb); 104 reiserfs_write_unlock(inode->i_sb);
105 return err; 105 return err;
106} 106}
@@ -1342,7 +1342,7 @@ static ssize_t reiserfs_file_write(struct file *file, /* the file we are going t
1342 if (unlikely(!access_ok(VERIFY_READ, buf, count))) 1342 if (unlikely(!access_ok(VERIFY_READ, buf, count)))
1343 return -EFAULT; 1343 return -EFAULT;
1344 1344
1345 down(&inode->i_sem); // locks the entire file for just us 1345 mutex_lock(&inode->i_mutex); // locks the entire file for just us
1346 1346
1347 pos = *ppos; 1347 pos = *ppos;
1348 1348
@@ -1532,12 +1532,12 @@ static ssize_t reiserfs_file_write(struct file *file, /* the file we are going t
1532 generic_osync_inode(inode, file->f_mapping, 1532 generic_osync_inode(inode, file->f_mapping,
1533 OSYNC_METADATA | OSYNC_DATA); 1533 OSYNC_METADATA | OSYNC_DATA);
1534 1534
1535 up(&inode->i_sem); 1535 mutex_unlock(&inode->i_mutex);
1536 reiserfs_async_progress_wait(inode->i_sb); 1536 reiserfs_async_progress_wait(inode->i_sb);
1537 return (already_written != 0) ? already_written : res; 1537 return (already_written != 0) ? already_written : res;
1538 1538
1539 out: 1539 out:
1540 up(&inode->i_sem); // unlock the file on exit. 1540 mutex_unlock(&inode->i_mutex); // unlock the file on exit.
1541 return res; 1541 return res;
1542} 1542}
1543 1543