Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218891
b: refs/heads/master
c: 7f93cff
h: refs/heads/master
i:
  218889: ee17f50
  218887: 6566c18
v: v3
  • Loading branch information
Theodore Ts'o committed Oct 28, 2010
1 parent fa49755 commit 193ed1d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 72f84e6560d18d60a091df27edf81409be6641cb
refs/heads/master: 7f93cff90fa9be6ed45f6189e136153d1d8631b0
7 changes: 5 additions & 2 deletions trunk/fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -3964,9 +3964,12 @@ static int ext4_commit_super(struct super_block *sb, int sync)
else
es->s_kbytes_written =
cpu_to_le64(EXT4_SB(sb)->s_kbytes_written);
ext4_free_blocks_count_set(es, percpu_counter_sum_positive(
if (percpu_counter_initialized(&EXT4_SB(sb)->s_freeblocks_counter))
ext4_free_blocks_count_set(es, percpu_counter_sum_positive(
&EXT4_SB(sb)->s_freeblocks_counter));
es->s_free_inodes_count = cpu_to_le32(percpu_counter_sum_positive(
if (percpu_counter_initialized(&EXT4_SB(sb)->s_freeinodes_counter))
es->s_free_inodes_count =
cpu_to_le32(percpu_counter_sum_positive(
&EXT4_SB(sb)->s_freeinodes_counter));
sb->s_dirt = 0;
BUFFER_TRACE(sbh, "marking dirty");
Expand Down
10 changes: 10 additions & 0 deletions trunk/include/linux/percpu_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
return 1;
}

static inline int percpu_counter_initialized(struct percpu_counter *fbc)
{
return (fbc->counters != NULL);
}

#else

struct percpu_counter {
Expand Down Expand Up @@ -143,6 +148,11 @@ static inline s64 percpu_counter_sum(struct percpu_counter *fbc)
return percpu_counter_read(fbc);
}

static inline int percpu_counter_initialized(struct percpu_counter *fbc)
{
return 1;
}

#endif /* CONFIG_SMP */

static inline void percpu_counter_inc(struct percpu_counter *fbc)
Expand Down

0 comments on commit 193ed1d

Please sign in to comment.