It's time to hack on dentry_stat?

From: rae l
Date: Wed May 07 2008 - 10:27:24 EST


I have noticed that struct dentry_stat_t dentry_stat is a struct with
six fields,
but only 2 of them are used, other 4 have never been used since v2.6.11,

from include/linux/dcache.h:

struct dentry_stat_t {
int nr_dentry;
int nr_unused;
int age_limit; /* age in seconds */
int want_pages; /* pages requested by system */
int dummy[2];
};
extern struct dentry_stat_t dentry_stat;

(I don't know things before v2.6.11, my local linux-2.6.git repository
can only grep to v2.6.11)

$ PAGER= git grep -w -e dentry_stat
Documentation/sysctl/fs.txt:} dentry_stat = {0, 0, 45, 0,};
fs/dcache.c:struct dentry_stat_t dentry_stat = {
fs/dcache.c: * no dcache_lock, please. The caller must decrement
dentry_stat.nr_dentry
fs/dcache.c: dentry_stat.nr_unused--;
fs/dcache.c: dentry_stat.nr_dentry--; /* For d_free, below */
fs/dcache.c: dentry_stat.nr_unused++;
fs/dcache.c: dentry_stat.nr_unused--;
fs/dcache.c: dentry_stat.nr_unused++;
fs/dcache.c: dentry_stat.nr_unused++;
fs/dcache.c: dentry_stat.nr_unused--;
fs/dcache.c: dentry_stat.nr_dentry -= detached;
fs/dcache.c: dentry_stat.nr_unused++;
fs/dcache.c: return (dentry_stat.nr_unused / 100) *
sysctl_vfs_cache_pressure;
fs/dcache.c: dentry_stat.nr_dentry++;
include/linux/dcache.h:extern struct dentry_stat_t dentry_stat;
kernel/sysctl.c: .data = &dentry_stat,

it's the same as that of v2.6.11:

$ PAGER= git grep -w -e dentry_stat v2.6.11 --
v2.6.11:Documentation/sysctl/fs.txt:} dentry_stat = {0, 0, 45, 0,};
v2.6.11:fs/dcache.c:struct dentry_stat_t dentry_stat = {
v2.6.11:fs/dcache.c: * no dcache_lock, please. The caller must
decrement dentry_stat.nr_dentry
v2.6.11:fs/dcache.c: dentry_stat.nr_unused++;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused--;
v2.6.11:fs/dcache.c: dentry_stat.nr_dentry--; /* For
d_free, below */
v2.6.11:fs/dcache.c: dentry_stat.nr_unused--;
v2.6.11:fs/dcache.c: dentry_stat.nr_dentry--; /* For d_free, below */
v2.6.11:fs/dcache.c: dentry_stat.nr_unused--;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused++;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused--;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused--;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused++;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused--;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused++;
v2.6.11:fs/dcache.c: return (dentry_stat.nr_unused / 100) *
sysctl_vfs_cache_pressure;
v2.6.11:fs/dcache.c: dentry_stat.nr_dentry++;
v2.6.11:include/linux/dcache.h:extern struct dentry_stat_t dentry_stat;
v2.6.11:kernel/sysctl.c: .data = &dentry_stat,

So I think that struct is outdated and can be simplified.

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