diff options
author | Nick Piggin <npiggin@suse.de> | 2010-01-29 15:38:28 -0800 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-04-27 17:32:42 +0200 |
commit | 1bb96f6d4dece641a9e9d7b97b109f6930967067 (patch) | |
tree | 25ee49409c0322ebcfd5c9d216bc2cfd11b5ff65 /fs/ext2 | |
parent | 81d2f3cb75bf112a21fad52e9d3e3a1d7d0c907d (diff) | |
download | lwn-1bb96f6d4dece641a9e9d7b97b109f6930967067.tar.gz lwn-1bb96f6d4dece641a9e9d7b97b109f6930967067.zip |
fs-inode_lock-scale-4
Protect inode->i_count with i_lock, rather than having it atomic.
Next step should also be to move things together (eg. the refcount increment
into d_instantiate, which will remove a lock/unlock cycle on i_lock).
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/namei.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index dd7175ce5606..34259ac72cef 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c @@ -196,7 +196,9 @@ static int ext2_link (struct dentry * old_dentry, struct inode * dir, inode->i_ctime = CURRENT_TIME_SEC; inode_inc_link_count(inode); - atomic_inc(&inode->i_count); + spin_lock(&inode->i_lock); + inode->i_count++; + spin_unlock(&inode->i_lock); err = ext2_add_link(dentry, inode); if (!err) { |