aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ext4_fs_i.h
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2008-01-28 23:58:26 -0500
committerTheodore Ts'o <tytso@mit.edu>2008-01-28 23:58:26 -0500
commit0e855ac8b103ef579052936b59fe7c599ac422a4 (patch)
treeec29f82e1d7bb1987dcadc00497daf69d6955483 /include/linux/ext4_fs_i.h
parentc278bfecebfb1ed67c326ef472660878baa745cd (diff)
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>
Diffstat (limited to 'include/linux/ext4_fs_i.h')
-rw-r--r--include/linux/ext4_fs_i.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/ext4_fs_i.h b/include/linux/ext4_fs_i.h
index f1cd4934e46f..4377d249d378 100644
--- a/include/linux/ext4_fs_i.h
+++ b/include/linux/ext4_fs_i.h
@@ -139,16 +139,16 @@ struct ext4_inode_info {
139 __u16 i_extra_isize; 139 __u16 i_extra_isize;
140 140
141 /* 141 /*
142 * truncate_mutex is for serialising ext4_truncate() against 142 * i_data_sem is for serialising ext4_truncate() against
143 * ext4_getblock(). In the 2.4 ext2 design, great chunks of inode's 143 * ext4_getblock(). In the 2.4 ext2 design, great chunks of inode's
144 * data tree are chopped off during truncate. We can't do that in 144 * data tree are chopped off during truncate. We can't do that in
145 * ext4 because whenever we perform intermediate commits during 145 * ext4 because whenever we perform intermediate commits during
146 * truncate, the inode and all the metadata blocks *must* be in a 146 * truncate, the inode and all the metadata blocks *must* be in a
147 * consistent state which allows truncation of the orphans to restart 147 * consistent state which allows truncation of the orphans to restart
148 * during recovery. Hence we must fix the get_block-vs-truncate race 148 * during recovery. Hence we must fix the get_block-vs-truncate race
149 * by other means, so we have truncate_mutex. 149 * by other means, so we have i_data_sem.
150 */ 150 */
151 struct mutex truncate_mutex; 151 struct rw_semaphore i_data_sem;
152 struct inode vfs_inode; 152 struct inode vfs_inode;
153 153
154 unsigned long i_ext_generation; 154 unsigned long i_ext_generation;