diff options
| author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-02-06 11:42:13 -0500 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:15 -0400 |
| commit | 4c97e04aa8818da266a690543aca28e2e7c26820 (patch) | |
| tree | 4e5568716eea0192460dc49c14ed94436485edc7 /fs/bcachefs/replicas.c | |
| parent | fe112812ae41bfed0aa61cdfbe8233e4122e5cb8 (diff) | |
| download | linux-4c97e04aa8818da266a690543aca28e2e7c26820.tar.gz linux-4c97e04aa8818da266a690543aca28e2e7c26820.tar.bz2 linux-4c97e04aa8818da266a690543aca28e2e7c26820.zip | |
bcachefs: percpu utility code
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/replicas.c')
| -rw-r--r-- | fs/bcachefs/replicas.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/bcachefs/replicas.c b/fs/bcachefs/replicas.c index 34a5475cfaba..5663441fd7ce 100644 --- a/fs/bcachefs/replicas.c +++ b/fs/bcachefs/replicas.c @@ -426,14 +426,12 @@ int bch2_replicas_gc_end(struct bch_fs *c, int ret) struct bch_replicas_entry *e = cpu_replicas_entry(&c->replicas, i); struct bch_replicas_cpu n; - u64 v = 0; - int cpu; + u64 v; if (__replicas_has_entry(&c->replicas_gc, e)) continue; - for_each_possible_cpu(cpu) - v += *per_cpu_ptr(&c->usage[0]->data[i], cpu); + v = percpu_u64_get(&c->usage[0]->data[i]); if (!v) continue; |
