lkml.org 
[lkml]   [2007]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[RFC 05/26] VFS: cache_lookup() cleanup
    cache_lookup() can directly use d_lookup() instead of calling __d_lookup()
    first since rename_lock is a seq_lock.

    Signed-off-by: Jan Blunck <jblunck@suse.de>
    ---
    fs/namei.c | 13 ++++---------
    1 file changed, 4 insertions(+), 9 deletions(-)

    --- a/fs/namei.c
    +++ b/fs/namei.c
    @@ -403,15 +403,10 @@ do_revalidate(struct dentry *dentry, str
    * Internal lookup() using the new generic dcache.
    * SMP-safe
    */
    -static struct dentry * cached_lookup(struct dentry * parent, struct qstr * name, struct nameidata *nd)
    +static struct dentry *cache_lookup(struct dentry *parent, struct qstr *name,
    + struct nameidata *nd)
    {
    - struct dentry * dentry = __d_lookup(parent, name);
    -
    - /* lockess __d_lookup may fail due to concurrent d_move()
    - * in some unrelated directory, so try with d_lookup
    - */
    - if (!dentry)
    - dentry = d_lookup(parent, name);
    + struct dentry *dentry = d_lookup(parent, name);

    if (dentry && dentry->d_op && dentry->d_op->d_revalidate)
    dentry = do_revalidate(dentry, nd);
    @@ -1276,7 +1271,7 @@ static inline struct dentry *__lookup_ha
    goto out;
    }

    - dentry = cached_lookup(base, name, nd);
    + dentry = cache_lookup(base, name, nd);
    if (!dentry) {
    struct dentry *new = d_alloc(base, name);
    dentry = ERR_PTR(-ENOMEM);
    --

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-07-30 18:19    [W:0.029 / U:61.636 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site