ext4: Convert truncate_mutex to read write semaphore.

We are currently taking the truncate_mutex for every read. This would have
performance impact on large CPU configuration. Convert the lock to read write
semaphore and take read lock when we are trying to read the file.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
This commit is contained in:
Aneesh Kumar K.V
2008-01-28 23:58:26 -05:00
committed by Theodore Ts'o
parent c278bfeceb
commit 0e855ac8b1
8 changed files with 53 additions and 43 deletions

View File

@@ -593,7 +593,7 @@ static void init_once(struct kmem_cache *cachep, void *foo)
#ifdef CONFIG_EXT4DEV_FS_XATTR
init_rwsem(&ei->xattr_sem);
#endif
mutex_init(&ei->truncate_mutex);
init_rwsem(&ei->i_data_sem);
inode_init_once(&ei->vfs_inode);
}