[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
@@ -40,12 +40,12 @@ void reiserfs_delete_inode(struct inode *inode)
|
||||
|
||||
/* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */
|
||||
if (!(inode->i_state & I_NEW) && INODE_PKEY(inode)->k_objectid != 0) { /* also handles bad_inode case */
|
||||
down(&inode->i_sem);
|
||||
mutex_lock(&inode->i_mutex);
|
||||
|
||||
reiserfs_delete_xattrs(inode);
|
||||
|
||||
if (journal_begin(&th, inode->i_sb, jbegin_count)) {
|
||||
up(&inode->i_sem);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
goto out;
|
||||
}
|
||||
reiserfs_update_inode_transaction(inode);
|
||||
@@ -59,11 +59,11 @@ void reiserfs_delete_inode(struct inode *inode)
|
||||
DQUOT_FREE_INODE(inode);
|
||||
|
||||
if (journal_end(&th, inode->i_sb, jbegin_count)) {
|
||||
up(&inode->i_sem);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
goto out;
|
||||
}
|
||||
|
||||
up(&inode->i_sem);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
|
||||
/* check return value from reiserfs_delete_object after
|
||||
* ending the transaction
|
||||
@@ -551,7 +551,7 @@ static int convert_tail_for_hole(struct inode *inode,
|
||||
|
||||
/* we don't have to make sure the conversion did not happen while
|
||||
** we were locking the page because anyone that could convert
|
||||
** must first take i_sem.
|
||||
** must first take i_mutex.
|
||||
**
|
||||
** We must fix the tail page for writing because it might have buffers
|
||||
** that are mapped, but have a block number of 0. This indicates tail
|
||||
@@ -586,7 +586,7 @@ static inline int _allocate_block(struct reiserfs_transaction_handle *th,
|
||||
BUG_ON(!th->t_trans_id);
|
||||
|
||||
#ifdef REISERFS_PREALLOCATE
|
||||
if (!(flags & GET_BLOCK_NO_ISEM)) {
|
||||
if (!(flags & GET_BLOCK_NO_IMUX)) {
|
||||
return reiserfs_new_unf_blocknrs2(th, inode, allocated_block_nr,
|
||||
path, block);
|
||||
}
|
||||
@@ -2318,7 +2318,7 @@ static int map_block_for_writepage(struct inode *inode,
|
||||
/* this is where we fill in holes in the file. */
|
||||
if (use_get_block) {
|
||||
retval = reiserfs_get_block(inode, block, bh_result,
|
||||
GET_BLOCK_CREATE | GET_BLOCK_NO_ISEM
|
||||
GET_BLOCK_CREATE | GET_BLOCK_NO_IMUX
|
||||
| GET_BLOCK_NO_DANGLE);
|
||||
if (!retval) {
|
||||
if (!buffer_mapped(bh_result)
|
||||
|
Reference in New Issue
Block a user