]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/dcache.c
jbd2: fix ERR_PTR dereference in jbd2__journal_start
[karo-tx-linux.git] / fs / dcache.c
index 3a463d0c4fe830d5c33c9dcf9ebd05e5caf5fb43..19153a0a810c1d12de751d5d416a5c1b6fe8c9bb 100644 (file)
@@ -454,24 +454,6 @@ void d_drop(struct dentry *dentry)
 }
 EXPORT_SYMBOL(d_drop);
 
-/*
- * d_clear_need_lookup - drop a dentry from cache and clear the need lookup flag
- * @dentry: dentry to drop
- *
- * This is called when we do a lookup on a placeholder dentry that needed to be
- * looked up.  The dentry should have been hashed in order for it to be found by
- * the lookup code, but now needs to be unhashed while we do the actual lookup
- * and clear the DCACHE_NEED_LOOKUP flag.
- */
-void d_clear_need_lookup(struct dentry *dentry)
-{
-       spin_lock(&dentry->d_lock);
-       __d_drop(dentry);
-       dentry->d_flags &= ~DCACHE_NEED_LOOKUP;
-       spin_unlock(&dentry->d_lock);
-}
-EXPORT_SYMBOL(d_clear_need_lookup);
-
 /*
  * Finish off a dentry we've decided to kill.
  * dentry->d_lock must be held, returns with it unlocked.
@@ -565,13 +547,7 @@ repeat:
        if (d_unhashed(dentry))
                goto kill_it;
 
-       /*
-        * If this dentry needs lookup, don't set the referenced flag so that it
-        * is more likely to be cleaned up by the dcache shrinker in case of
-        * memory pressure.
-        */
-       if (!d_need_lookup(dentry))
-               dentry->d_flags |= DCACHE_REFERENCED;
+       dentry->d_flags |= DCACHE_REFERENCED;
        dentry_lru_add(dentry);
 
        dentry->d_count--;
@@ -1583,7 +1559,7 @@ EXPORT_SYMBOL(d_find_any_alias);
  */
 struct dentry *d_obtain_alias(struct inode *inode)
 {
-       static const struct qstr anonstring = { .name = "" };
+       static const struct qstr anonstring = QSTR_INIT("/", 1);
        struct dentry *tmp;
        struct dentry *res;
 
@@ -1736,13 +1712,6 @@ struct dentry *d_add_ci(struct dentry *dentry, struct inode *inode,
                return found;
        }
 
-       /*
-        * We are going to instantiate this dentry, unhash it and clear the
-        * lookup flag so we can do that.
-        */
-       if (unlikely(d_need_lookup(found)))
-               d_clear_need_lookup(found);
-
        /*
         * Negative dentry: instantiate it unless the inode is a directory and
         * already has a dentry.