diff --git a/fs/dcache.c b/fs/dcache.c index 3a3adc4..a8be4c9 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -116,12 +116,12 @@ struct dentry_stat_t dentry_stat = { .age_limit = 45, }; -static DEFINE_PER_CPU(unsigned int, nr_dentry); -static DEFINE_PER_CPU(unsigned int, nr_dentry_unused); +static DEFINE_PER_CPU(long, nr_dentry); +static DEFINE_PER_CPU(long, nr_dentry_unused); #if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS) /* scan possible cpus instead of online and avoid worrying about CPU hotplug. */ -static int get_nr_dentry(void) +static long get_nr_dentry(void) { int i; int sum = 0; @@ -130,7 +130,7 @@ static int get_nr_dentry(void) return sum < 0 ? 0 : sum; } -static int get_nr_dentry_unused(void) +static long get_nr_dentry_unused(void) { int i; int sum = 0; @@ -144,7 +144,7 @@ int proc_nr_dentry(ctl_table *table, int write, void __user *buffer, { dentry_stat.nr_dentry = get_nr_dentry(); dentry_stat.nr_unused = get_nr_dentry_unused(); - return proc_dointvec(table, write, buffer, lenp, ppos); + return proc_doulongvec_minmax(table, write, buffer, lenp, ppos); } #endif diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 4d24a12..bd08285 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -54,11 +54,11 @@ struct qstr { #define hashlen_len(hashlen) ((u32)((hashlen) >> 32)) 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]; + long nr_dentry; + long nr_unused; + long age_limit; /* age in seconds */ + long want_pages; /* pages requested by system */ + long dummy[2]; }; extern struct dentry_stat_t dentry_stat; diff --git a/include/linux/fs.h b/include/linux/fs.h index 67e1040..e875f60 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1267,12 +1267,12 @@ struct super_block { /* s_dentry_lru_lock protects s_dentry_lru and s_nr_dentry_unused */ spinlock_t s_dentry_lru_lock ____cacheline_aligned_in_smp; struct list_head s_dentry_lru; /* unused dentry lru */ - int s_nr_dentry_unused; /* # of dentry on lru */ + long s_nr_dentry_unused; /* # of dentry on lru */ /* s_inode_lru_lock protects s_inode_lru and s_nr_inodes_unused */ spinlock_t s_inode_lru_lock ____cacheline_aligned_in_smp; struct list_head s_inode_lru; /* unused inode lru */ - int s_nr_inodes_unused; /* # of inodes on lru */ + long s_nr_inodes_unused; /* # of inodes on lru */ struct block_device *s_bdev; struct backing_dev_info *s_bdi; diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 9edcf45..0dc51c0 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1493,7 +1493,7 @@ static struct ctl_table fs_table[] = { { .procname = "dentry-state", .data = &dentry_stat, - .maxlen = 6*sizeof(int), + .maxlen = 6*sizeof(long), .mode = 0444, .proc_handler = proc_nr_dentry, },