From patchwork Mon Aug 15 17:36:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 9281691 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7E2A6607FD for ; Mon, 15 Aug 2016 17:41:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7119D28DDF for ; Mon, 15 Aug 2016 17:41:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 657D028E14; Mon, 15 Aug 2016 17:41:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0919128DDF for ; Mon, 15 Aug 2016 17:41:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7FHbbxA009417; Mon, 15 Aug 2016 13:37:38 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u7FHbbkI029679 for ; Mon, 15 Aug 2016 13:37:37 -0400 Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7FHbaqH007065 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Aug 2016 13:37:36 -0400 Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com [209.85.220.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F27685542; Mon, 15 Aug 2016 17:37:36 +0000 (UTC) Received: by mail-qk0-f193.google.com with SMTP id x189so4716707qkd.0; Mon, 15 Aug 2016 10:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Q7NBsZYvBeQN2FzZh3VjqpRZPHzbSlFRwF2lT3P9W90=; b=nvmXs/FwNRJQFPv5EkkJxSK7toqwIKQ0CnbEr6p9jGFRpibIOB340bMlCTnA6wELBy 7Y5Z1Fr8zN16jBRWQUYXH8GJ85WQrHfKwJ291e4bo64iyV3C84QA87rINdcbTh34cC98 PAxq+ohXPUJ5tibF/bcsxtGYndZ9DjeQJCsixctuLEphMJwim5tT+p2SrwATtvAUL9VG y7Ei5EJEpQqSSWtQMnENZZkjg67ybgQCMoA8TLlyNXQ76R/S87YzPtI7Xr7fG3T3dNNU W9l5kXRYH9X4G6CK1do0Hhamph+pEGsjIneO9+X1TA/9azH4Zuow3InB6jLXy9WtQiZr 8bXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Q7NBsZYvBeQN2FzZh3VjqpRZPHzbSlFRwF2lT3P9W90=; b=JYMHUOYWH730rU3QV+VBg/+zmI1DMJHPqudtE++7Zh2BzE3/oGMccOn0JKv2stegIN D5fLYEilh/tMDZ5/MVx1wz+rvGBMPhCB/wNFAFJ4DvV/67xI31DIQ2WhaD/pKLvmIzfG oa/O+z+gb9rjOdP/zz9+xK8VfRJoYbTjjptIat5CaSdn1SE7SebE5Pnx7eCxaKQUKBhI ebJc1sqIuumh0U7PxKION1wtV4MetM9c15yTFacFae6QNAMD1zGyZu1Jpl86T4G5Om1Z FfcpZwJFpENvEI2OUcmuM6AQKSB+adGwcqZ6rCKL682JSprGogsbezPycyU+sZFLChFn aObg== X-Gm-Message-State: AEkooutRsgyopMZX7+4d7czye32i0N/qHoDeYmyqTWlTK8cO2VVpyIU6cOuuj6hj9hzusg== X-Received: by 10.55.151.199 with SMTP id z190mr18039128qkd.56.1471282655347; Mon, 15 Aug 2016 10:37:35 -0700 (PDT) Received: from localhost.localdomain (50-39-103-96.bvtn.or.frontiernet.net. [50.39.103.96]) by smtp.gmail.com with ESMTPSA id n128sm11636084qkc.36.2016.08.15.10.37.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Aug 2016 10:37:34 -0700 (PDT) From: Ram Pai To: LKML , linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-doc@vger.kernel.org Date: Mon, 15 Aug 2016 10:36:42 -0700 Message-Id: <1471282613-31006-6-git-send-email-linuxram@us.ibm.com> In-Reply-To: <1471282613-31006-1-git-send-email-linuxram@us.ibm.com> References: <1471282613-31006-1-git-send-email-linuxram@us.ibm.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 15 Aug 2016 17:37:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 15 Aug 2016 17:37:36 +0000 (UTC) for IP:'209.85.220.193' DOMAIN:'mail-qk0-f193.google.com' HELO:'mail-qk0-f193.google.com' FROM:'ram.n.pai@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.719 (BAYES_40, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.220.193 mail-qk0-f193.google.com 209.85.220.193 mail-qk0-f193.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-loop: dm-devel@redhat.com Cc: shli@kernel.org, snitzer@redhat.com, agk@redhat.com, corbet@lwn.net Subject: [dm-devel] [RFC PATCH 05/16] DM: allocation/free helper routines. X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Virus-Scanned: ClamAV using ClamSMTP Helper functions to allocate/reallocate and free memory. Signed-off-by: Ram Pai --- 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);