movinggc.c (6f10f7d1b02b1bbc305f88d7696445dd38b13881) movinggc.c (1fae7cf05293d3a2c9e59c1bc59372322386467c)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Moving/copying garbage collector
4 *
5 * Copyright 2012 Google, Inc.
6 */
7
8#include "bcache.h"

--- 24 unchanged lines hidden (view full) ---

33 return false;
34}
35
36/* Moving GC - IO loop */
37
38static void moving_io_destructor(struct closure *cl)
39{
40 struct moving_io *io = container_of(cl, struct moving_io, cl);
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Moving/copying garbage collector
4 *
5 * Copyright 2012 Google, Inc.
6 */
7
8#include "bcache.h"

--- 24 unchanged lines hidden (view full) ---

33 return false;
34}
35
36/* Moving GC - IO loop */
37
38static void moving_io_destructor(struct closure *cl)
39{
40 struct moving_io *io = container_of(cl, struct moving_io, cl);
41
41 kfree(io);
42}
43
44static void write_moving_finish(struct closure *cl)
45{
46 struct moving_io *io = container_of(cl, struct moving_io, cl);
47 struct bio *bio = &io->bio.bio;
48

--- 135 unchanged lines hidden (view full) ---

184static bool bucket_cmp(struct bucket *l, struct bucket *r)
185{
186 return GC_SECTORS_USED(l) < GC_SECTORS_USED(r);
187}
188
189static unsigned int bucket_heap_top(struct cache *ca)
190{
191 struct bucket *b;
42 kfree(io);
43}
44
45static void write_moving_finish(struct closure *cl)
46{
47 struct moving_io *io = container_of(cl, struct moving_io, cl);
48 struct bio *bio = &io->bio.bio;
49

--- 135 unchanged lines hidden (view full) ---

185static bool bucket_cmp(struct bucket *l, struct bucket *r)
186{
187 return GC_SECTORS_USED(l) < GC_SECTORS_USED(r);
188}
189
190static unsigned int bucket_heap_top(struct cache *ca)
191{
192 struct bucket *b;
193
192 return (b = heap_peek(&ca->heap)) ? GC_SECTORS_USED(b) : 0;
193}
194
195void bch_moving_gc(struct cache_set *c)
196{
197 struct cache *ca;
198 struct bucket *b;
199 unsigned int i;

--- 53 unchanged lines hidden ---
194 return (b = heap_peek(&ca->heap)) ? GC_SECTORS_USED(b) : 0;
195}
196
197void bch_moving_gc(struct cache_set *c)
198{
199 struct cache *ca;
200 struct bucket *b;
201 unsigned int i;

--- 53 unchanged lines hidden ---