]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
vfs: Make d_invalidate return void
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 13 Feb 2014 17:46:25 +0000 (09:46 -0800)
committerEric W. Biederman <ebiederm@xmission.com>
Tue, 25 Feb 2014 03:48:38 +0000 (19:48 -0800)
Now that d_invalidate can no longer fail, stop returning a useless
return code.  For the few callers that checked the return code update
remove the handling of d_invalidate failure.

Reviewed-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/btrfs/ioctl.c
fs/cifs/readdir.c
fs/dcache.c
fs/fuse/dir.c
fs/namei.c
fs/nfs/dir.c
include/linux/dcache.h

index b0134892dc70cdf69be04ad44e3e52183a86fcb0..349848bd54e24f95c986efd6fe4bcf24b7857139 100644 (file)
@@ -2229,9 +2229,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
        }
 
        mutex_lock(&inode->i_mutex);
-       err = d_invalidate(dentry);
-       if (err)
-               goto out_unlock;
+       d_invalidate(dentry);
 
        down_write(&root->fs_info->subvol_sem);
 
@@ -2316,7 +2314,6 @@ out_release:
        btrfs_subvolume_release_metadata(root, &block_rsv, qgroup_reserved);
 out_up_write:
        up_write(&root->fs_info->subvol_sem);
-out_unlock:
        mutex_unlock(&inode->i_mutex);
        if (!err) {
                shrink_dcache_sb(root->fs_info->sb);
index b15862e0f68c3c749a7cf6278dc6d3666ba71ccc..d0e9d0169b37e2a6eed87c6dab03adc6cb5b2281 100644 (file)
@@ -87,8 +87,6 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
                return;
 
        if (dentry) {
-               int err;
-
                inode = dentry->d_inode;
                if (inode) {
                        /*
@@ -105,10 +103,8 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
                                goto out;
                        }
                }
-               err = d_invalidate(dentry);
+               d_invalidate(dentry);
                dput(dentry);
-               if (err)
-                       return;
        }
 
        /*
index 5b41205cbf335f71a19b066209d34e8467db44a6..5b78bd98649ceb1eb3271f6a448d4766554fffac 100644 (file)
@@ -1377,27 +1377,21 @@ static void check_and_drop(void *_data)
  * d_invalidate - detach submounts, prune dcache, and drop
  * @dentry: dentry to invalidate (aka detach, prune and drop)
  *
- * Try to invalidate the dentry if it turns out to be
- * possible. If there are reasons not to delete it
- * return -EBUSY. On success return 0.
- *
  * no dcache lock.
  *
  * The final d_drop is done as an atomic operation relative to
  * rename_lock ensuring there are no races with d_set_mounted.  This
  * ensures there are no unhashed dentries on the path to a mountpoint.
  */
-int d_invalidate(struct dentry *dentry)
+void d_invalidate(struct dentry *dentry)
 {
-       int ret = 0;
-
        /*
         * If it's already been dropped, return OK.
         */
        spin_lock(&dentry->d_lock);
        if (d_unhashed(dentry)) {
                spin_unlock(&dentry->d_lock);
-               return 0;
+               return;
        }
        spin_unlock(&dentry->d_lock);
 
@@ -1432,7 +1426,7 @@ int d_invalidate(struct dentry *dentry)
        }
 
 out:
-       return ret;
+       return;
 }
 EXPORT_SYMBOL(d_invalidate);
 
index 5192d0a04d20e9a8c9a6ff14601eb0898e45908d..6e920fadb45d1b328886800093b951fe8efae528 100644 (file)
@@ -1225,9 +1225,7 @@ static int fuse_direntplus_link(struct file *file,
                        d_drop(dentry);
                } else if (get_node_id(inode) != o->nodeid ||
                           ((o->attr.mode ^ inode->i_mode) & S_IFMT)) {
-                       err = d_invalidate(dentry);
-                       if (err)
-                               goto out;
+                       d_invalidate(dentry);
                } else if (is_bad_inode(inode)) {
                        err = -EIO;
                        goto out;
index 3fca30cd448b8100290019acca32a376a5db1521..384fcc6a5606e9fcc2ea76028b728f0af568618c 100644 (file)
@@ -1259,7 +1259,8 @@ static struct dentry *lookup_dcache(struct qstr *name, struct dentry *dir,
                                if (error < 0) {
                                        dput(dentry);
                                        return ERR_PTR(error);
-                               } else if (!d_invalidate(dentry)) {
+                               } else {
+                                       d_invalidate(dentry);
                                        dput(dentry);
                                        dentry = NULL;
                                }
@@ -1391,10 +1392,9 @@ unlazy:
                        dput(dentry);
                        return status;
                }
-               if (!d_invalidate(dentry)) {
-                       dput(dentry);
-                       goto need_lookup;
-               }
+               d_invalidate(dentry);
+               dput(dentry);
+               goto need_lookup;
        }
 
        path->mnt = mnt;
index a8a2f7f86c4501ea5adc1845f7038bed5c3b65c5..a2b2b6d17c1f388a1f8534546cb53f9cfbd0731e 100644 (file)
@@ -464,8 +464,7 @@ void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry)
                                nfs_setsecurity(dentry->d_inode, entry->fattr, entry->label);
                        goto out;
                } else {
-                       if (d_invalidate(dentry) != 0)
-                               goto out;
+                       d_invalidate(dentry);
                        dput(dentry);
                }
        }
index ae77222c3e86413371269cd85af78f05bc7985d7..95ddb0bdadb0eb9b520013c7ac942ce47442fdf9 100644 (file)
@@ -250,7 +250,7 @@ extern struct dentry * d_obtain_alias(struct inode *);
 extern void shrink_dcache_sb(struct super_block *);
 extern void shrink_dcache_parent(struct dentry *);
 extern void shrink_dcache_for_umount(struct super_block *);
-extern int d_invalidate(struct dentry *);
+extern void d_invalidate(struct dentry *);
 
 /* only used at mount-time */
 extern struct dentry * d_make_root(struct inode *);