aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 93a0625b46e4..2a3c37ea823d 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -70,33 +70,33 @@ EXPORT_SYMBOL(empty_aops);
70 */ 70 */
71struct inodes_stat_t inodes_stat; 71struct inodes_stat_t inodes_stat;
72 72
73static DEFINE_PER_CPU(unsigned int, nr_inodes); 73static DEFINE_PER_CPU(unsigned long, nr_inodes);
74static DEFINE_PER_CPU(unsigned int, nr_unused); 74static DEFINE_PER_CPU(unsigned long, nr_unused);
75 75
76static struct kmem_cache *inode_cachep __read_mostly; 76static struct kmem_cache *inode_cachep __read_mostly;
77 77
78static int get_nr_inodes(void) 78static long get_nr_inodes(void)
79{ 79{
80 int i; 80 int i;
81 int sum = 0; 81 long sum = 0;
82 for_each_possible_cpu(i) 82 for_each_possible_cpu(i)
83 sum += per_cpu(nr_inodes, i); 83 sum += per_cpu(nr_inodes, i);
84 return sum < 0 ? 0 : sum; 84 return sum < 0 ? 0 : sum;
85} 85}
86 86
87static inline int get_nr_inodes_unused(void) 87static inline long get_nr_inodes_unused(void)
88{ 88{
89 int i; 89 int i;
90 int sum = 0; 90 long sum = 0;
91 for_each_possible_cpu(i) 91 for_each_possible_cpu(i)
92 sum += per_cpu(nr_unused, i); 92 sum += per_cpu(nr_unused, i);
93 return sum < 0 ? 0 : sum; 93 return sum < 0 ? 0 : sum;
94} 94}
95 95
96int get_nr_dirty_inodes(void) 96long get_nr_dirty_inodes(void)
97{ 97{
98 /* not actually dirty inodes, but a wild approximation */ 98 /* not actually dirty inodes, but a wild approximation */
99 int nr_dirty = get_nr_inodes() - get_nr_inodes_unused(); 99 long nr_dirty = get_nr_inodes() - get_nr_inodes_unused();
100 return nr_dirty > 0 ? nr_dirty : 0; 100 return nr_dirty > 0 ? nr_dirty : 0;
101} 101}
102 102
@@ -109,7 +109,7 @@ int proc_nr_inodes(ctl_table *table, int write,
109{ 109{
110 inodes_stat.nr_inodes = get_nr_inodes(); 110 inodes_stat.nr_inodes = get_nr_inodes();
111 inodes_stat.nr_unused = get_nr_inodes_unused(); 111 inodes_stat.nr_unused = get_nr_inodes_unused();
112 return proc_dointvec(table, write, buffer, lenp, ppos); 112 return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
113} 113}
114#endif 114#endif
115 115