diff options
author | Kent Overstreet <koverstreet@google.com> | 2013-03-25 22:46:44 +0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-03-25 23:06:13 +0400 |
commit | b1a67b0f4c747ca10c96ebb24f04e2a74b3c298d (patch) | |
tree | 32ff70d72673de4e99ae3b8c517540ccbe6a547f /drivers/md/bcache/alloc.c | |
parent | 07e86ccb543bb1e748f32d6f0f18913d3f58d988 (diff) | |
download | linux-b1a67b0f4c747ca10c96ebb24f04e2a74b3c298d.tar.xz |
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>
Diffstat (limited to 'drivers/md/bcache/alloc.c')
-rw-r--r-- | drivers/md/bcache/alloc.c | 22 |
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; |