lkml.org 
[lkml]   [2002]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Lse-tech] [RFC] dcache scalability patch (2.4.17)
> diff -urN linux-2.4.17-base/fs/dcache.c linux-2.4.17-dc8/fs/dcache.c
> --- linux-2.4.17-base/fs/dcache.c Fri Dec 21 23:11:55 2001
> +++ linux-2.4.17-dc8/fs/dcache.c Fri Jul 12 16:18:39 2002
> @@ -25,6 +25,7 @@
> #include <linux/module.h>
>
> #include <asm/uaccess.h>
> +#include <linux/rcupdate.h>

Please try to include <linux/*.h> before <asm/*.h> headers.


> +static void d_callback(void *arg)
> +{
> + struct dentry * dentry = (struct dentry *)arg;
> +
> + if (dname_external(dentry))
> + kfree((void *) dentry->d_name.name);
> + kmem_cache_free(dentry_cache, dentry);
> +}

why do you cast to void * before calling kfree?

> - /* dput on a free dentry? */
> - if (!list_empty(&dentry->d_lru))
> - BUG();
> + spin_lock(&dentry->d_lock);
> + if (atomic_read(&dentry->d_count)) {
> + spin_unlock(&dentry->d_lock);
> + spin_unlock(&dcache_lock);
> + return;
> + }
> +

Please use tabs instead of eight spaces in kernel code.

Another implementation details is whether we shouldn't spin on a bit of
->d_vfs_flags instead of increasing struct dentry further. Maybe the
spin_lock_bit interface that wli prototypes might be a godd choise.

Else the patch looks fine to me, although I'm wondering why you target 2.4.17
-
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: 2005-03-22 13:22    [W:0.162 / U:2.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site