aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPekka Enberg <penberg@kernel.org>2015-06-30 17:59:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-30 22:45:00 -0400
commit958b43384e41c129117284f48ba3fb9c11ebac75 (patch)
treecc5fe88ba48cca5d102368ae53f2a0b13f8cf26d
parent32a78facdd0a5e77d18d03dbe53e0823d249b0bb (diff)
bcache: use kvfree() in various places
Use kvfree() instead of open-coding it. Signed-off-by: Pekka Enberg <penberg@kernel.org> Cc: Kent Overstreet <kmo@daterainc.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/md/bcache/super.c10
-rw-r--r--drivers/md/bcache/util.h10
2 files changed, 4 insertions, 16 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 4dd2bb7167f0..94980bfca434 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -760,14 +760,8 @@ static void bcache_device_free(struct bcache_device *d)
760 bio_split_pool_free(&d->bio_split_hook); 760 bio_split_pool_free(&d->bio_split_hook);
761 if (d->bio_split) 761 if (d->bio_split)
762 bioset_free(d->bio_split); 762 bioset_free(d->bio_split);
763 if (is_vmalloc_addr(d->full_dirty_stripes)) 763 kvfree(d->full_dirty_stripes);
764 vfree(d->full_dirty_stripes); 764 kvfree(d->stripe_sectors_dirty);
765 else
766 kfree(d->full_dirty_stripes);
767 if (is_vmalloc_addr(d->stripe_sectors_dirty))
768 vfree(d->stripe_sectors_dirty);
769 else
770 kfree(d->stripe_sectors_dirty);
771 765
772 closure_debug_destroy(&d->cl); 766 closure_debug_destroy(&d->cl);
773} 767}
diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h
index 98df7572b5f7..1d04c4859c70 100644
--- a/drivers/md/bcache/util.h
+++ b/drivers/md/bcache/util.h
@@ -52,10 +52,7 @@ struct closure;
52 52
53#define free_heap(heap) \ 53#define free_heap(heap) \
54do { \ 54do { \
55 if (is_vmalloc_addr((heap)->data)) \ 55 kvfree((heap)->data); \
56 vfree((heap)->data); \
57 else \
58 kfree((heap)->data); \
59 (heap)->data = NULL; \ 56 (heap)->data = NULL; \
60} while (0) 57} while (0)
61 58
@@ -163,10 +160,7 @@ do { \
163 160
164#define free_fifo(fifo) \ 161#define free_fifo(fifo) \
165do { \ 162do { \
166 if (is_vmalloc_addr((fifo)->data)) \ 163 kvfree((fifo)->data); \
167 vfree((fifo)->data); \
168 else \
169 kfree((fifo)->data); \
170 (fifo)->data = NULL; \ 164 (fifo)->data = NULL; \
171} while (0) 165} while (0)
172 166