Re: [PATCH] dcache.{c,h} cleanup

Dan Aloni (da-x@gmx.net)
Fri, 31 May 2002 16:03:21 +0300


On Fri, May 31, 2002 at 02:56:23PM +0530, Maneesh Soni wrote:
> On Fri, 31 May 2002 14:02:07 +0530, Dan Aloni wrote:
>
> > + use d_unhashed() instead of list_empty(&dentry->d_hash)
> There are few more list_empty(...->d_hash)s left
>
> fs/intermezzo/journal.c presto_path
> fs/libfs.c dcache_dir_lseek
> fs/libfs.c dcache_readdir
> kernel/exit.c __unhash_process

I'll send a patch to rusty.

> > if (dentry->d_op && dentry->d_op->d_delete) {
> > if (dentry->d_op->d_delete(dentry))
> > - goto unhash_it;
> > + goto kill_it;
> > }
> > /* Unreachable? Get rid of it */
> > - if (list_empty(&dentry->d_hash))
> > + if (d_unhashed(dentry))
> > goto kill_it;
> ^^^^^^^^^^^^^
> This will do list_del_init on a already unhashed dentry.
>

I am awake of this. From what I've seen, a second list_del_init
is a no-op, and this one-liner doesn't yell 'refactor me'.

> > -unhash_it:
> > - list_del_init(&dentry->d_hash);
> > +kill_it:
> > + parent = d_release(dentry);
> > + if (dentry == parent)

-- 
Dan Aloni
da-x@gmx.net
-
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/