summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-04-16 17:48:24 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2016-08-28 19:15:17 -0800
commitf2369c6f67142b1b61a80d11180f593cf6a4598e (patch)
tree300d4defdfa57077c706458e1ec0e312d50f7210
parentbf2528e1c75f161533b79e963e508eb971e2ebf0 (diff)
bcache: fix warnings
-rw-r--r--fs/bcachefs/extents.c6
-rw-r--r--fs/bcachefs/extents.h12
-rw-r--r--fs/bcachefs/movinggc.c15
3 files changed, 17 insertions, 16 deletions
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index 8310b8cb898a..eb25ca261f7f 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -1815,7 +1815,6 @@ static void extent_sort_ptrs(struct cache_set *c, struct bkey_s_extent e)
{
struct cache_member_rcu *mi;
struct bch_extent_ptr *ptr, *prev = NULL;
- union bch_extent_crc *crc;
/*
* First check if any pointers are out of order before doing the actual
@@ -1823,9 +1822,8 @@ static void extent_sort_ptrs(struct cache_set *c, struct bkey_s_extent e)
*/
mi = cache_member_info_get(c);
- extent_for_each_ptr_crc(e, ptr, crc)
- if (prev &&
- PTR_TIER(mi, ptr) < PTR_TIER(mi, prev)) {
+ extent_for_each_ptr(e, ptr)
+ if (prev && PTR_TIER(mi, ptr) < PTR_TIER(mi, prev)) {
__extent_sort_ptrs(mi, e);
break;
}
diff --git a/fs/bcachefs/extents.h b/fs/bcachefs/extents.h
index 5d97828dbd5c..9d78e4bec6b1 100644
--- a/fs/bcachefs/extents.h
+++ b/fs/bcachefs/extents.h
@@ -284,9 +284,19 @@ out: \
#define extent_ptr_next_filter(_e, _ptr, _filter) \
({ \
+ __label__ out; \
typeof(__entry_to_crc(&(_e).v->start[0])) _crc; \
\
- extent_ptr_crc_next_filter(_e, _crc, _ptr, _filter); \
+ extent_for_each_entry_from(_e, _entry, (void *) _ptr) \
+ if (!extent_entry_is_crc(_entry)) { \
+ _ptr = (typeof(_ptr)) &_entry->ptr; \
+ if (_filter) \
+ goto out; \
+ } \
+ \
+ _ptr = NULL; \
+out: \
+ _ptr; \
})
#define extent_ptr_next(_e, _ptr) \
diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c
index 22f6fb8dd212..0c77ea6c808c 100644
--- a/fs/bcachefs/movinggc.c
+++ b/fs/bcachefs/movinggc.c
@@ -148,11 +148,10 @@ static void read_moving(struct cache *ca, struct moving_context *ctxt)
} while (!kthread_should_stop() && again);
}
-static bool bch_moving_gc(struct cache *ca)
+static void bch_moving_gc(struct cache *ca)
{
struct cache_set *c = ca->set;
struct bucket *g;
- bool moved = false;
u64 sectors_to_move, sectors_gen, gen_current, sectors_total;
size_t buckets_to_move, buckets_unused = 0;
@@ -178,7 +177,7 @@ static bool bch_moving_gc(struct cache *ca)
if (reserve_sectors < (int) c->sb.block_size) {
trace_bcache_moving_gc_reserve_empty(ca);
- return false;
+ return;
}
trace_bcache_moving_gc_start(ca);
@@ -222,7 +221,7 @@ static bool bch_moving_gc(struct cache *ca)
sectors_to_move < reserve_sectors) {
mutex_unlock(&ca->heap_lock);
trace_bcache_moving_gc_no_work(ca);
- return false;
+ return;
}
while (sectors_to_move > reserve_sectors) {
@@ -232,9 +231,6 @@ static bool bch_moving_gc(struct cache *ca)
buckets_to_move = ca->heap.used;
- if (sectors_to_move)
- moved = true;
-
/*
* resort by write_prio to group into generations, attempts to
* keep hot and cold data in the same locality.
@@ -268,8 +264,6 @@ static bool bch_moving_gc(struct cache *ca)
trace_bcache_moving_gc_end(ca, ctxt.sectors_moved, ctxt.keys_moved,
buckets_to_move);
-
- return moved;
}
static int bch_moving_gc_thread(void *arg)
@@ -279,7 +273,6 @@ static int bch_moving_gc_thread(void *arg)
struct io_clock *clock = &c->io_clock[WRITE];
unsigned long last;
s64 next;
- bool moved;
set_freezable();
@@ -298,7 +291,7 @@ static int bch_moving_gc_thread(void *arg)
ca->mi.bucket_size;
if (next <= 0)
- moved = bch_moving_gc(ca);
+ bch_moving_gc(ca);
else
bch_kthread_io_clock_wait(clock, last + next);
}