[RFC PATCH 05/16] DM: allocation/free helper routines.

From: Ram Pai
Date: Mon Aug 15 2016 - 13:40:04 EST


Helper functions to allocate/reallocate and free memory.

Signed-off-by: Ram Pai <linuxram@xxxxxxxxxx>
---
drivers/md/dm-inplace-compress.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/md/dm-inplace-compress.c b/drivers/md/dm-inplace-compress.c
index bf18028..c11567c 100644
--- a/drivers/md/dm-inplace-compress.c
+++ b/drivers/md/dm-inplace-compress.c
@@ -774,6 +774,23 @@ static void dm_icomp_get_req(struct dm_icomp_req *req)
atomic_inc(&req->io_pending);
}

+static void *dm_icomp_kmalloc(size_t size, gfp_t flags)
+{
+ return kmalloc(size, flags);
+}
+
+static void *dm_icomp_krealloc(void *addr, size_t size,
+ size_t orig_size, gfp_t flags)
+{
+ return krealloc(addr, size, flags);
+}
+
+static void dm_icomp_kfree(void *addr, unsigned int size)
+{
+ kfree(addr);
+}
+
+
static void dm_icomp_free_io_range(struct dm_icomp_io_range *io)
{
kfree(io->decomp_data);
--
1.7.1