vfs: Remove the unnecessary protect.
PATCH 1/1 vfs: Remove the unnecessary protect.
After allocating a inode,it don't chain in superblock.At this time,it won't be used by others.So it make no sense to protect there.
---fs/inode.c | 2 --
1 file changed, 2 deletions(-)
fs/inode.c +0 -0
@@ -906,9 +906,7 @@ struct inode *new_inode_pseudo(struct super_block *sb)
struct inode *inode = alloc_inode(sb);
if (inode) {
- spin_lock(&inode->i_lock);inode->i_state = 0;
- spin_unlock(&inode->i_lock);INIT_LIST_HEAD(&inode->i_sb_list);
}
return inode;
Signature · 1 line
1.8.2.rc2.4.g7799588
Jan Kara
reviewerQuoted 2 lines · majianpeng
After allocating a inode,it don't chain in superblock.At this time,it won't be used by others.So it make no sense to protect there.
Something (likely your mailer) has mangled whitespace in your patch.
Please submit patches with a program that preserves whitespace (preferred) or use text/plain attachments.
Also I don't think the argument for removing i_lock locking is as simple. Without the lock, i_state initialization can be speculatively performed earlier / later wrt other instructions by the CPU so it's not clear this cannot cause problems to some of the callers.
Honza
Quoted 27 lines
Signed-off-by Jianpeng Ma <[email protected]>---
fs/inode.c| 2 --1 file changed, 2 deletions(-)fs/inode.c +0
-2@@ -906,9 +906,7 @@ struct inode *new_inode_pseudo(struct super_block *sb)struct inode *inode =alloc_inode (sb);if (inode) { -spin_lock (&inode->i_lock); inode->i_state =0 ; -spin_unlock (&inode->i_lock);INIT_LIST_HEAD (&inode->i_sb_list); }return inode;Signature · 7 lines
1.8.2.rc2.4.g7799588 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR