mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
32a78facdd
commit
958b43384e
|
@ -760,14 +760,8 @@ static void bcache_device_free(struct bcache_device *d)
|
||||||
bio_split_pool_free(&d->bio_split_hook);
|
bio_split_pool_free(&d->bio_split_hook);
|
||||||
if (d->bio_split)
|
if (d->bio_split)
|
||||||
bioset_free(d->bio_split);
|
bioset_free(d->bio_split);
|
||||||
if (is_vmalloc_addr(d->full_dirty_stripes))
|
kvfree(d->full_dirty_stripes);
|
||||||
vfree(d->full_dirty_stripes);
|
kvfree(d->stripe_sectors_dirty);
|
||||||
else
|
|
||||||
kfree(d->full_dirty_stripes);
|
|
||||||
if (is_vmalloc_addr(d->stripe_sectors_dirty))
|
|
||||||
vfree(d->stripe_sectors_dirty);
|
|
||||||
else
|
|
||||||
kfree(d->stripe_sectors_dirty);
|
|
||||||
|
|
||||||
closure_debug_destroy(&d->cl);
|
closure_debug_destroy(&d->cl);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,10 +52,7 @@ struct closure;
|
||||||
|
|
||||||
#define free_heap(heap) \
|
#define free_heap(heap) \
|
||||||
do { \
|
do { \
|
||||||
if (is_vmalloc_addr((heap)->data)) \
|
kvfree((heap)->data); \
|
||||||
vfree((heap)->data); \
|
|
||||||
else \
|
|
||||||
kfree((heap)->data); \
|
|
||||||
(heap)->data = NULL; \
|
(heap)->data = NULL; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
@ -163,10 +160,7 @@ do { \
|
||||||
|
|
||||||
#define free_fifo(fifo) \
|
#define free_fifo(fifo) \
|
||||||
do { \
|
do { \
|
||||||
if (is_vmalloc_addr((fifo)->data)) \
|
kvfree((fifo)->data); \
|
||||||
vfree((fifo)->data); \
|
|
||||||
else \
|
|
||||||
kfree((fifo)->data); \
|
|
||||||
(fifo)->data = NULL; \
|
(fifo)->data = NULL; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue