diff options
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/inode.c b/fs/inode.c index c6165771e00e..ed35383d0b6c 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -99,6 +99,15 @@ struct inodes_stat_t inodes_stat; | |||
99 | 99 | ||
100 | static struct kmem_cache * inode_cachep __read_mostly; | 100 | static struct kmem_cache * inode_cachep __read_mostly; |
101 | 101 | ||
102 | static void wake_up_inode(struct inode *inode) | ||
103 | { | ||
104 | /* | ||
105 | * Prevent speculative execution through spin_unlock(&inode_lock); | ||
106 | */ | ||
107 | smp_mb(); | ||
108 | wake_up_bit(&inode->i_state, __I_LOCK); | ||
109 | } | ||
110 | |||
102 | static struct inode *alloc_inode(struct super_block *sb) | 111 | static struct inode *alloc_inode(struct super_block *sb) |
103 | { | 112 | { |
104 | static const struct address_space_operations empty_aops; | 113 | static const struct address_space_operations empty_aops; |
@@ -232,7 +241,7 @@ void __iget(struct inode * inode) | |||
232 | return; | 241 | return; |
233 | } | 242 | } |
234 | atomic_inc(&inode->i_count); | 243 | atomic_inc(&inode->i_count); |
235 | if (!(inode->i_state & (I_DIRTY|I_LOCK))) | 244 | if (!(inode->i_state & (I_DIRTY|I_SYNC))) |
236 | list_move(&inode->i_list, &inode_in_use); | 245 | list_move(&inode->i_list, &inode_in_use); |
237 | inodes_stat.nr_unused--; | 246 | inodes_stat.nr_unused--; |
238 | } | 247 | } |
@@ -253,7 +262,7 @@ void clear_inode(struct inode *inode) | |||
253 | BUG_ON(inode->i_data.nrpages); | 262 | BUG_ON(inode->i_data.nrpages); |
254 | BUG_ON(!(inode->i_state & I_FREEING)); | 263 | BUG_ON(!(inode->i_state & I_FREEING)); |
255 | BUG_ON(inode->i_state & I_CLEAR); | 264 | BUG_ON(inode->i_state & I_CLEAR); |
256 | wait_on_inode(inode); | 265 | inode_sync_wait(inode); |
257 | DQUOT_DROP(inode); | 266 | DQUOT_DROP(inode); |
258 | if (inode->i_sb->s_op->clear_inode) | 267 | if (inode->i_sb->s_op->clear_inode) |
259 | inode->i_sb->s_op->clear_inode(inode); | 268 | inode->i_sb->s_op->clear_inode(inode); |
@@ -1071,7 +1080,7 @@ static void generic_forget_inode(struct inode *inode) | |||
1071 | struct super_block *sb = inode->i_sb; | 1080 | struct super_block *sb = inode->i_sb; |
1072 | 1081 | ||
1073 | if (!hlist_unhashed(&inode->i_hash)) { | 1082 | if (!hlist_unhashed(&inode->i_hash)) { |
1074 | if (!(inode->i_state & (I_DIRTY|I_LOCK))) | 1083 | if (!(inode->i_state & (I_DIRTY|I_SYNC))) |
1075 | list_move(&inode->i_list, &inode_unused); | 1084 | list_move(&inode->i_list, &inode_unused); |
1076 | inodes_stat.nr_unused++; | 1085 | inodes_stat.nr_unused++; |
1077 | if (sb->s_flags & MS_ACTIVE) { | 1086 | if (sb->s_flags & MS_ACTIVE) { |
@@ -1314,15 +1323,6 @@ static void __wait_on_freeing_inode(struct inode *inode) | |||
1314 | spin_lock(&inode_lock); | 1323 | spin_lock(&inode_lock); |
1315 | } | 1324 | } |
1316 | 1325 | ||
1317 | void wake_up_inode(struct inode *inode) | ||
1318 | { | ||
1319 | /* | ||
1320 | * Prevent speculative execution through spin_unlock(&inode_lock); | ||
1321 | */ | ||
1322 | smp_mb(); | ||
1323 | wake_up_bit(&inode->i_state, __I_LOCK); | ||
1324 | } | ||
1325 | |||
1326 | /* | 1326 | /* |
1327 | * We rarely want to lock two inodes that do not have a parent/child | 1327 | * We rarely want to lock two inodes that do not have a parent/child |
1328 | * relationship (such as directory, child inode) simultaneously. The | 1328 | * relationship (such as directory, child inode) simultaneously. The |