bcache: Style/checkpatch fixes
Took out some nested functions, and fixed some more checkpatch
complaints.
Signed-off-by: Kent Overstreet <koverstreet@google.com>
Cc: linux-bcache@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c
index ed18115..2879487 100644
--- a/drivers/md/bcache/alloc.c
+++ b/drivers/md/bcache/alloc.c
@@ -229,24 +229,14 @@
fifo_push(&ca->free_inc, b - ca->buckets);
}
+#define bucket_prio(b) \
+ (((unsigned) (b->prio - ca->set->min_prio)) * GC_SECTORS_USED(b))
+
+#define bucket_max_cmp(l, r) (bucket_prio(l) < bucket_prio(r))
+#define bucket_min_cmp(l, r) (bucket_prio(l) > bucket_prio(r))
+
static void invalidate_buckets_lru(struct cache *ca)
{
- unsigned bucket_prio(struct bucket *b)
- {
- return ((unsigned) (b->prio - ca->set->min_prio)) *
- GC_SECTORS_USED(b);
- }
-
- bool bucket_max_cmp(struct bucket *l, struct bucket *r)
- {
- return bucket_prio(l) < bucket_prio(r);
- }
-
- bool bucket_min_cmp(struct bucket *l, struct bucket *r)
- {
- return bucket_prio(l) > bucket_prio(r);
- }
-
struct bucket *b;
ssize_t i;