diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-06-06 15:16:17 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-08-09 16:48:06 -0400 |
commit | e971a6d7b9daebfe2c11c590377d3933410ab929 (patch) | |
tree | 35f7f416ffa61b19000669cd19c614ea1911ab14 | |
parent | f053ddde7575090e09e2f5c4233d8a19f0925b93 (diff) |
stop icache pollution in hostfs, switch to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 7943ff11d489..fab5f5a1e6f0 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -241,16 +241,13 @@ static struct inode *hostfs_iget(struct super_block *sb) | |||
241 | struct inode *inode; | 241 | struct inode *inode; |
242 | long ret; | 242 | long ret; |
243 | 243 | ||
244 | inode = iget_locked(sb, 0); | 244 | inode = new_inode(sb); |
245 | if (!inode) | 245 | if (!inode) |
246 | return ERR_PTR(-ENOMEM); | 246 | return ERR_PTR(-ENOMEM); |
247 | if (inode->i_state & I_NEW) { | 247 | ret = hostfs_read_inode(inode); |
248 | ret = hostfs_read_inode(inode); | 248 | if (ret < 0) { |
249 | if (ret < 0) { | 249 | iput(inode); |
250 | iget_failed(inode); | 250 | return ERR_PTR(ret); |
251 | return ERR_PTR(ret); | ||
252 | } | ||
253 | unlock_new_inode(inode); | ||
254 | } | 251 | } |
255 | return inode; | 252 | return inode; |
256 | } | 253 | } |
@@ -299,29 +296,19 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb) | |||
299 | return &hi->vfs_inode; | 296 | return &hi->vfs_inode; |
300 | } | 297 | } |
301 | 298 | ||
302 | static void hostfs_delete_inode(struct inode *inode) | 299 | static void hostfs_evict_inode(struct inode *inode) |
303 | { | 300 | { |
304 | truncate_inode_pages(&inode->i_data, 0); | 301 | truncate_inode_pages(&inode->i_data, 0); |
302 | end_writeback(inode); | ||
305 | if (HOSTFS_I(inode)->fd != -1) { | 303 | if (HOSTFS_I(inode)->fd != -1) { |
306 | close_file(&HOSTFS_I(inode)->fd); | 304 | close_file(&HOSTFS_I(inode)->fd); |
307 | HOSTFS_I(inode)->fd = -1; | 305 | HOSTFS_I(inode)->fd = -1; |
308 | } | 306 | } |
309 | clear_inode(inode); | ||
310 | } | 307 | } |
311 | 308 | ||
312 | static void hostfs_destroy_inode(struct inode *inode) | 309 | static void hostfs_destroy_inode(struct inode *inode) |
313 | { | 310 | { |
314 | kfree(HOSTFS_I(inode)->host_filename); | 311 | kfree(HOSTFS_I(inode)->host_filename); |
315 | |||
316 | /* | ||
317 | * XXX: This should not happen, probably. The check is here for | ||
318 | * additional safety. | ||
319 | */ | ||
320 | if (HOSTFS_I(inode)->fd != -1) { | ||
321 | close_file(&HOSTFS_I(inode)->fd); | ||
322 | printk(KERN_DEBUG "Closing host fd in .destroy_inode\n"); | ||
323 | } | ||
324 | |||
325 | kfree(HOSTFS_I(inode)); | 312 | kfree(HOSTFS_I(inode)); |
326 | } | 313 | } |
327 | 314 | ||
@@ -339,9 +326,8 @@ static int hostfs_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
339 | 326 | ||
340 | static const struct super_operations hostfs_sbops = { | 327 | static const struct super_operations hostfs_sbops = { |
341 | .alloc_inode = hostfs_alloc_inode, | 328 | .alloc_inode = hostfs_alloc_inode, |
342 | .drop_inode = generic_delete_inode, | ||
343 | .delete_inode = hostfs_delete_inode, | ||
344 | .destroy_inode = hostfs_destroy_inode, | 329 | .destroy_inode = hostfs_destroy_inode, |
330 | .evict_inode = hostfs_evict_inode, | ||
345 | .statfs = hostfs_statfs, | 331 | .statfs = hostfs_statfs, |
346 | .show_options = hostfs_show_options, | 332 | .show_options = hostfs_show_options, |
347 | }; | 333 | }; |