diff options
author | Nick Piggin <npiggin@suse.de> | 2010-01-29 15:38:32 -0800 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-04-27 17:32:50 +0200 |
commit | 7e835af8566b68c0396256cdcb371f62e9cdb5fa (patch) | |
tree | d1d44193381034ed938125cca99817fe7aeaa3de /fs/quota | |
parent | a119db1dc3f3a6da86148960937383ce0c162ad4 (diff) | |
download | lwn-7e835af8566b68c0396256cdcb371f62e9cdb5fa.tar.gz lwn-7e835af8566b68c0396256cdcb371f62e9cdb5fa.zip |
fs-inode_lock-scale-11
This enables locking to be reduced and simplified.
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/quota')
-rw-r--r-- | fs/quota/dquot.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 5305c71ccea5..7d5ecefc4091 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -844,8 +844,8 @@ static void add_dquot_ref(struct super_block *sb, int type) struct inode *inode, *old_inode = NULL; int reserved = 0; - spin_lock(&sb_inode_list_lock); - list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { + rcu_read_lock(); + list_for_each_entry_rcu(inode, &sb->s_inodes, i_sb_list) { spin_lock(&inode->i_lock); if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW)) { spin_unlock(&inode->i_lock); @@ -867,7 +867,7 @@ static void add_dquot_ref(struct super_block *sb, int type) __iget(inode); spin_unlock(&inode->i_lock); - spin_unlock(&sb_inode_list_lock); + rcu_read_unlock(); iput(old_inode); sb->dq_op->initialize(inode, type); @@ -877,9 +877,9 @@ static void add_dquot_ref(struct super_block *sb, int type) * reference and we cannot iput it under inode_lock. So we * keep the reference and iput it later. */ old_inode = inode; - spin_lock(&sb_inode_list_lock); + rcu_read_lock(); } - spin_unlock(&sb_inode_list_lock); + rcu_read_unlock(); iput(old_inode); if (reserved) { @@ -955,8 +955,8 @@ static void remove_dquot_ref(struct super_block *sb, int type, { struct inode *inode; - spin_lock(&sb_inode_list_lock); - list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { + rcu_read_lock(); + list_for_each_entry_rcu(inode, &sb->s_inodes, i_sb_list) { /* * We have to scan also I_NEW inodes because they can already * have quota pointer initialized. Luckily, we need to touch @@ -966,7 +966,7 @@ static void remove_dquot_ref(struct super_block *sb, int type, if (!IS_NOQUOTA(inode)) remove_inode_dquot_ref(inode, type, tofree_head); } - spin_unlock(&sb_inode_list_lock); + rcu_read_unlock(); } /* Gather all references from inodes and drop them */ |