summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/bcache/alloc.c')
-rw-r--r--drivers/md/bcache/alloc.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c
index ed18115e078e..2879487d036a 100644
--- a/drivers/md/bcache/alloc.c
+++ b/drivers/md/bcache/alloc.c
@@ -229,24 +229,14 @@ static void invalidate_one_bucket(struct cache *ca, struct bucket *b)
fifo_push(&ca->free_inc, b - ca->buckets);
}
-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);
- }
+#define bucket_prio(b) \
+ (((unsigned) (b->prio - ca->set->min_prio)) * GC_SECTORS_USED(b))
- bool bucket_min_cmp(struct bucket *l, struct bucket *r)
- {
- return bucket_prio(l) > bucket_prio(r);
- }
+#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)
+{
struct bucket *b;
ssize_t i;