switch sysv to ->evict_inode()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 5 Jun 2010 23:16:20 +0000 (19:16 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 9 Aug 2010 20:47:59 +0000 (16:47 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/sysv/ialloc.c
fs/sysv/inode.c

index fcc498ec9b337afdcb96582fce07734c9a3cb46d..0c96c98bd1db25b44b3f2279dcc5a1c35ed93ecb 100644 (file)
@@ -113,7 +113,6 @@ void sysv_free_inode(struct inode * inode)
                return;
        }
        raw_inode = sysv_raw_inode(sb, ino, &bh);
-       clear_inode(inode);
        if (!raw_inode) {
                printk("sysv_free_inode: unable to read inode block on device "
                       "%s\n", inode->i_sb->s_id);
index d4a5380b566955549a2ee8cf005d724a2a53cede..613a5056e880bfd82eccdf47b37085b1b057876b 100644 (file)
@@ -308,12 +308,17 @@ int sysv_sync_inode(struct inode *inode)
        return __sysv_write_inode(inode, 1);
 }
 
-static void sysv_delete_inode(struct inode *inode)
+static void sysv_evict_inode(struct inode *inode)
 {
        truncate_inode_pages(&inode->i_data, 0);
-       inode->i_size = 0;
-       sysv_truncate(inode);
-       sysv_free_inode(inode);
+       if (!inode->i_nlink) {
+               inode->i_size = 0;
+               sysv_truncate(inode);
+       }
+       invalidate_inode_buffers(inode);
+       end_writeback(inode);
+       if (!inode->i_nlink)
+               sysv_free_inode(inode);
 }
 
 static struct kmem_cache *sysv_inode_cachep;
@@ -344,7 +349,7 @@ const struct super_operations sysv_sops = {
        .alloc_inode    = sysv_alloc_inode,
        .destroy_inode  = sysv_destroy_inode,
        .write_inode    = sysv_write_inode,
-       .delete_inode   = sysv_delete_inode,
+       .evict_inode    = sysv_evict_inode,
        .put_super      = sysv_put_super,
        .write_super    = sysv_write_super,
        .sync_fs        = sysv_sync_fs,