aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2007-10-17 02:25:44 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:42:44 -0400
commit52d9f3b4090922f34497ace82bd062d80a465a29 (patch)
tree77ee238498a5b205fa80e58b41212a9e3334c8bf
parent3a587f47b82f96f19318c036e7b979fcd5c3848f (diff)
lib: percpu_counter_sum_positive
s/percpu_counter_sum/&_positive/ Because its consitent with percpu_counter_read* Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/ext3/super.c4
-rw-r--r--fs/ext4/super.c4
-rw-r--r--fs/file_table.c2
-rw-r--r--include/linux/percpu_counter.h4
-rw-r--r--lib/percpu_counter.c4
5 files changed, 9 insertions, 9 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 9537316a0714..c5a52c9775a0 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2472,13 +2472,13 @@ static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf)
2472 buf->f_type = EXT3_SUPER_MAGIC; 2472 buf->f_type = EXT3_SUPER_MAGIC;
2473 buf->f_bsize = sb->s_blocksize; 2473 buf->f_bsize = sb->s_blocksize;
2474 buf->f_blocks = le32_to_cpu(es->s_blocks_count) - sbi->s_overhead_last; 2474 buf->f_blocks = le32_to_cpu(es->s_blocks_count) - sbi->s_overhead_last;
2475 buf->f_bfree = percpu_counter_sum(&sbi->s_freeblocks_counter); 2475 buf->f_bfree = percpu_counter_sum_positive(&sbi->s_freeblocks_counter);
2476 es->s_free_blocks_count = cpu_to_le32(buf->f_bfree); 2476 es->s_free_blocks_count = cpu_to_le32(buf->f_bfree);
2477 buf->f_bavail = buf->f_bfree - le32_to_cpu(es->s_r_blocks_count); 2477 buf->f_bavail = buf->f_bfree - le32_to_cpu(es->s_r_blocks_count);
2478 if (buf->f_bfree < le32_to_cpu(es->s_r_blocks_count)) 2478 if (buf->f_bfree < le32_to_cpu(es->s_r_blocks_count))
2479 buf->f_bavail = 0; 2479 buf->f_bavail = 0;
2480 buf->f_files = le32_to_cpu(es->s_inodes_count); 2480 buf->f_files = le32_to_cpu(es->s_inodes_count);
2481 buf->f_ffree = percpu_counter_sum(&sbi->s_freeinodes_counter); 2481 buf->f_ffree = percpu_counter_sum_positive(&sbi->s_freeinodes_counter);
2482 es->s_free_inodes_count = cpu_to_le32(buf->f_ffree); 2482 es->s_free_inodes_count = cpu_to_le32(buf->f_ffree);
2483 buf->f_namelen = EXT3_NAME_LEN; 2483 buf->f_namelen = EXT3_NAME_LEN;
2484 fsid = le64_to_cpup((void *)es->s_uuid) ^ 2484 fsid = le64_to_cpup((void *)es->s_uuid) ^
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 3c1397fa83df..1814d4b8ff1f 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2592,13 +2592,13 @@ static int ext4_statfs (struct dentry * dentry, struct kstatfs * buf)
2592 buf->f_type = EXT4_SUPER_MAGIC; 2592 buf->f_type = EXT4_SUPER_MAGIC;
2593 buf->f_bsize = sb->s_blocksize; 2593 buf->f_bsize = sb->s_blocksize;
2594 buf->f_blocks = ext4_blocks_count(es) - sbi->s_overhead_last; 2594 buf->f_blocks = ext4_blocks_count(es) - sbi->s_overhead_last;
2595 buf->f_bfree = percpu_counter_sum(&sbi->s_freeblocks_counter); 2595 buf->f_bfree = percpu_counter_sum_positive(&sbi->s_freeblocks_counter);
2596 es->s_free_blocks_count = cpu_to_le32(buf->f_bfree); 2596 es->s_free_blocks_count = cpu_to_le32(buf->f_bfree);
2597 buf->f_bavail = buf->f_bfree - ext4_r_blocks_count(es); 2597 buf->f_bavail = buf->f_bfree - ext4_r_blocks_count(es);
2598 if (buf->f_bfree < ext4_r_blocks_count(es)) 2598 if (buf->f_bfree < ext4_r_blocks_count(es))
2599 buf->f_bavail = 0; 2599 buf->f_bavail = 0;
2600 buf->f_files = le32_to_cpu(es->s_inodes_count); 2600 buf->f_files = le32_to_cpu(es->s_inodes_count);
2601 buf->f_ffree = percpu_counter_sum(&sbi->s_freeinodes_counter); 2601 buf->f_ffree = percpu_counter_sum_positive(&sbi->s_freeinodes_counter);
2602 es->s_free_inodes_count = cpu_to_le32(buf->f_ffree); 2602 es->s_free_inodes_count = cpu_to_le32(buf->f_ffree);
2603 buf->f_namelen = EXT4_NAME_LEN; 2603 buf->f_namelen = EXT4_NAME_LEN;
2604 fsid = le64_to_cpup((void *)es->s_uuid) ^ 2604 fsid = le64_to_cpup((void *)es->s_uuid) ^
diff --git a/fs/file_table.c b/fs/file_table.c
index d17fd691b832..287fdce7f767 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -98,7 +98,7 @@ struct file *get_empty_filp(void)
98 * percpu_counters are inaccurate. Do an expensive check before 98 * percpu_counters are inaccurate. Do an expensive check before
99 * we go and fail. 99 * we go and fail.
100 */ 100 */
101 if (percpu_counter_sum(&nr_files) >= files_stat.max_files) 101 if (percpu_counter_sum_positive(&nr_files) >= files_stat.max_files)
102 goto over; 102 goto over;
103 } 103 }
104 104
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 2da92e8ce3dd..dd89eb978393 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -34,7 +34,7 @@ void percpu_counter_init(struct percpu_counter *fbc, s64 amount);
34void percpu_counter_destroy(struct percpu_counter *fbc); 34void percpu_counter_destroy(struct percpu_counter *fbc);
35void percpu_counter_set(struct percpu_counter *fbc, s64 amount); 35void percpu_counter_set(struct percpu_counter *fbc, s64 amount);
36void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); 36void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch);
37s64 percpu_counter_sum(struct percpu_counter *fbc); 37s64 percpu_counter_sum_positive(struct percpu_counter *fbc);
38 38
39static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) 39static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount)
40{ 40{
@@ -102,7 +102,7 @@ static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
102 return fbc->count; 102 return fbc->count;
103} 103}
104 104
105static inline s64 percpu_counter_sum(struct percpu_counter *fbc) 105static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc)
106{ 106{
107 return percpu_counter_read_positive(fbc); 107 return percpu_counter_read_positive(fbc);
108} 108}
diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c
index c9708db9b8d3..b0d80ea22a33 100644
--- a/lib/percpu_counter.c
+++ b/lib/percpu_counter.c
@@ -52,7 +52,7 @@ EXPORT_SYMBOL(__percpu_counter_add);
52 * Add up all the per-cpu counts, return the result. This is a more accurate 52 * Add up all the per-cpu counts, return the result. This is a more accurate
53 * but much slower version of percpu_counter_read_positive() 53 * but much slower version of percpu_counter_read_positive()
54 */ 54 */
55s64 percpu_counter_sum(struct percpu_counter *fbc) 55s64 percpu_counter_sum_positive(struct percpu_counter *fbc)
56{ 56{
57 s64 ret; 57 s64 ret;
58 int cpu; 58 int cpu;
@@ -66,7 +66,7 @@ s64 percpu_counter_sum(struct percpu_counter *fbc)
66 spin_unlock(&fbc->lock); 66 spin_unlock(&fbc->lock);
67 return ret < 0 ? 0 : ret; 67 return ret < 0 ? 0 : ret;
68} 68}
69EXPORT_SYMBOL(percpu_counter_sum); 69EXPORT_SYMBOL(percpu_counter_sum_positive);
70 70
71void percpu_counter_init(struct percpu_counter *fbc, s64 amount) 71void percpu_counter_init(struct percpu_counter *fbc, s64 amount)
72{ 72{