Unionfs: new vfs_statfs and ->evict_inode prototypes
authorErez Zadok <ezk@cs.sunysb.edu>
Wed, 11 Aug 2010 05:30:28 +0000 (01:30 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 29 Apr 2011 02:26:50 +0000 (22:26 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/super.c

index a8f557127a6148400217f0989854028ffa00f802..1bd49f5fd0ba21c2ee870486de2f9a6c705b97f8 100644 (file)
@@ -73,31 +73,6 @@ struct inode *unionfs_iget(struct super_block *sb, unsigned long ino)
        return inode;
 }
 
-/*
- * we now define delete_inode, because there are two VFS paths that may
- * destroy an inode: one of them calls clear inode before doing everything
- * else that's needed, and the other is fine.  This way we truncate the inode
- * size (and its pages) and then clear our own inode, which will do an iput
- * on our and the lower inode.
- *
- * No need to lock sb info's rwsem.
- */
-static void unionfs_delete_inode(struct inode *inode)
-{
-#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
-       spin_lock(&inode->i_lock);
-#endif
-       i_size_write(inode, 0); /* every f/s seems to do that */
-#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
-       spin_unlock(&inode->i_lock);
-#endif
-
-       if (inode->i_data.nrpages)
-               truncate_inode_pages(&inode->i_data, 0);
-
-       clear_inode(inode);
-}
-
 /*
  * final actions when unmounting a file system
  *
@@ -151,6 +126,7 @@ static int unionfs_statfs(struct dentry *dentry, struct kstatfs *buf)
        struct super_block *sb;
        struct dentry *lower_dentry;
        struct dentry *parent;
+       struct path lower_path;
        bool valid;
 
        sb = dentry->d_sb;
@@ -167,7 +143,9 @@ static int unionfs_statfs(struct dentry *dentry, struct kstatfs *buf)
        unionfs_check_dentry(dentry);
 
        lower_dentry = unionfs_lower_dentry(sb->s_root);
-       err = vfs_statfs(lower_dentry, buf);
+       lower_path.dentry = lower_dentry;
+       lower_path.mnt = NULL;
+       err = vfs_statfs(&lower_path, buf);
 
        /* set return buf to our f/s to avoid confusing user-level utils */
        buf->f_type = UNIONFS_SUPER_MAGIC;
@@ -848,7 +826,7 @@ out_error:
  *
  * No need to lock sb info's rwsem.
  */
-static void unionfs_clear_inode(struct inode *inode)
+static void unionfs_evict_inode(struct inode *inode)
 {
        int bindex, bstart, bend;
        struct inode *lower_inode;
@@ -1035,11 +1013,10 @@ out:
 }
 
 struct super_operations unionfs_sops = {
-       .delete_inode   = unionfs_delete_inode,
        .put_super      = unionfs_put_super,
        .statfs         = unionfs_statfs,
        .remount_fs     = unionfs_remount_fs,
-       .clear_inode    = unionfs_clear_inode,
+       .evict_inode    = unionfs_evict_inode,
        .umount_begin   = unionfs_umount_begin,
        .show_options   = unionfs_show_options,
        .write_inode    = unionfs_write_inode,