linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* It's time to hack on dentry_stat?
@ 2008-05-07 14:26 rae l
  2008-05-07 14:51 ` Matthew Wilcox
  0 siblings, 1 reply; 7+ messages in thread
From: rae l @ 2008-05-07 14:26 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-05-07 16:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-07 14:26 It's time to hack on dentry_stat? rae l
2008-05-07 14:51 ` Matthew Wilcox
2008-05-07 15:06   ` rae l
2008-05-07 15:08   ` Ray Lee
2008-05-07 15:25     ` Matthew Wilcox
2008-05-07 16:10       ` Ray Lee
2008-05-07 16:32         ` rae l

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).