From patchwork Fri May 6 18:03:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 9035351 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 310A09F1D3 for ; Fri, 6 May 2016 18:07:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4054520274 for ; Fri, 6 May 2016 18:07:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4678220272 for ; Fri, 6 May 2016 18:07:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932300AbcEFSD4 (ORCPT ); Fri, 6 May 2016 14:03:56 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:36530 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758768AbcEFSDx (ORCPT ); Fri, 6 May 2016 14:03:53 -0400 Received: by mail-wm0-f45.google.com with SMTP id n129so67108939wmn.1 for ; Fri, 06 May 2016 11:03:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a9dJyOE3V9D05QxWSygTUIERngLLG2tF+/jgJL/Sv5w=; b=J/F6GLocaa5n/37auBUE0WwTtp9mkRAshvR3zibDeEIVU/3yXTDRGfIdZsx1W7aG4z pONGYWGWQ5PPEja+ITofHVF4DwHqvdRMSZ1k1xFuJsJ57koxd452nkKj2Cfb939vjBBo bZgNNdaueLf8Pcrw4HiBzwgdxO1zJHzJdEjcg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a9dJyOE3V9D05QxWSygTUIERngLLG2tF+/jgJL/Sv5w=; b=VUOQNs3YCBpIBcbxCtzuiql7OdZpNaAFVzPsclsLrxp7rbceAMfJWYMTDNocF0mG/o 7iRfInIpTMS8DVsoepO9UkDdpARNv75KVIuAbYMtUjWBNoOqtZgsVGMlFizjv7dEwq/7 9OvTPwKRYp78eGVSMT3oufnRx6zGGx7x3OxAk7uYAojNBJ///4owEWS8j4gSdWr/w8gn VYHxHSPkBsZ+JG9dvQt59eJ3HbYODXkFNHaczfpvKa/ghL+rn/oM0mN14cCxXBIglMrv Pk19hNs5GUASSoizQJazF5Ft7tWdE55SmbTuHzabU+/3Pmk8fkxNOdAPDMnatFRd5uJq 6xFw== X-Gm-Message-State: AOPr4FWAPmkDSxFD2iHcHmfIa4ywJqHtY3XEOL2Wp/NJ3SzLOKtiEWK4TNTwCdyBh/4NIQ== X-Received: by 10.28.126.133 with SMTP id z127mr10788907wmc.68.1462557832501; Fri, 06 May 2016 11:03:52 -0700 (PDT) Received: from Macroninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id kz1sm16076559wjc.46.2016.05.06.11.03.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 May 2016 11:03:51 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 20/28] lightnvm: rename dma helper functions Date: Fri, 6 May 2016 20:03:13 +0200 Message-Id: <1462557801-24974-21-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1462557801-24974-1-git-send-email-m@bjorling.me> References: <1462557801-24974-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Javier González Until now, the dma pool have been exclusively used to allocate the ppa list being sent to the device. In pblk (upcoming), we use these pools to allocate metadata too. Thus, we generalize the names of some variables on the dma helper functions to make the code more readable. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/core.c | 16 ++++++++-------- drivers/nvme/host/lightnvm.c | 4 ++-- include/linux/lightnvm.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index de5db7b..1873a3b 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -87,15 +87,15 @@ EXPORT_SYMBOL(nvm_unregister_tgt_type); void *nvm_dev_dma_alloc(struct nvm_dev *dev, gfp_t mem_flags, dma_addr_t *dma_handler) { - return dev->ops->dev_dma_alloc(dev, dev->ppalist_pool, mem_flags, + return dev->ops->dev_dma_alloc(dev, dev->dma_pool, mem_flags, dma_handler); } EXPORT_SYMBOL(nvm_dev_dma_alloc); -void nvm_dev_dma_free(struct nvm_dev *dev, void *ppa_list, +void nvm_dev_dma_free(struct nvm_dev *dev, void *addr, dma_addr_t dma_handler) { - dev->ops->dev_dma_free(dev->ppalist_pool, ppa_list, dma_handler); + dev->ops->dev_dma_free(dev->dma_pool, addr, dma_handler); } EXPORT_SYMBOL(nvm_dev_dma_free); @@ -652,8 +652,8 @@ err: static void nvm_exit(struct nvm_dev *dev) { - if (dev->ppalist_pool) - dev->ops->destroy_dma_pool(dev->ppalist_pool); + if (dev->dma_pool) + dev->ops->destroy_dma_pool(dev->dma_pool); nvm_free(dev); pr_info("nvm: successfully unloaded\n"); @@ -687,9 +687,9 @@ int nvm_register(struct request_queue *q, char *disk_name, } if (dev->ops->max_phys_sect > 1) { - dev->ppalist_pool = dev->ops->create_dma_pool(dev, "ppalist"); - if (!dev->ppalist_pool) { - pr_err("nvm: could not create ppa pool\n"); + dev->dma_pool = dev->ops->create_dma_pool(dev, "ppalist"); + if (!dev->dma_pool) { + pr_err("nvm: could not create dma pool\n"); ret = -ENOMEM; goto err_init; } diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index 69a47fb..8461f5a 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -565,10 +565,10 @@ static void *nvme_nvm_dev_dma_alloc(struct nvm_dev *dev, void *pool, return dma_pool_alloc(pool, mem_flags, dma_handler); } -static void nvme_nvm_dev_dma_free(void *pool, void *ppa_list, +static void nvme_nvm_dev_dma_free(void *pool, void *addr, dma_addr_t dma_handler) { - dma_pool_free(pool, ppa_list, dma_handler); + dma_pool_free(pool, addr, dma_handler); } static struct nvm_dev_ops nvme_nvm_dev_ops = { diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index 678df4d..0e8e019 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -347,7 +347,7 @@ struct nvm_dev { unsigned max_pages_per_blk; unsigned long *lun_map; - void *ppalist_pool; + void *dma_pool; struct nvm_id identity;