From patchwork Tue Jan 12 06:49:28 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: 8014181 X-Patchwork-Delegate: axboe@kernel.dk 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 E2A679F6FA for ; Tue, 12 Jan 2016 06:56:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A25520379 for ; Tue, 12 Jan 2016 06:56:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2CFEF20386 for ; Tue, 12 Jan 2016 06:56:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753758AbcALGvS (ORCPT ); Tue, 12 Jan 2016 01:51:18 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:36409 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761139AbcALGuM (ORCPT ); Tue, 12 Jan 2016 01:50:12 -0500 Received: by mail-wm0-f47.google.com with SMTP id l65so238872047wmf.1 for ; Mon, 11 Jan 2016 22:50:11 -0800 (PST) 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-type:content-transfer-encoding; bh=wQF2VXyi1Sv70pZ829MrMti+c1KxnHgZF9Wu6rX/KlE=; b=wMtuWIYHG2Dpebvlty5YCVq5PWKrXbyMgRC6yTkOM5vT7T23NJDtAJYvuY4AeIWR+e CcmXs12ghnZmQxvpLRhGMi3/z8gxXEJhTXhUGCkHZz1715KgVht5IB00uXn6EPMMVA+m AUSTls365dzNTnEL2oWTKioxYwwPU90o+rjdU= 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-type:content-transfer-encoding; bh=wQF2VXyi1Sv70pZ829MrMti+c1KxnHgZF9Wu6rX/KlE=; b=KyOL9UpqeN6B64SWwSMQ17gFmXKlyEt0pBrX3oWN/1dbAyxN2oTjlJNCwiZKSh3e+V +MIReidUgLOI2Z8Tkk25FzDqcmbgQF0Trq+7MVJaVwp4nNFG/coLmejvN3ontMiwum9a aNYuyCq7n2oOJdU4YZSvHz0lYc77jZ84GGi4Z3JG/vkI6vd46Ub9SraqUCyCPzzbfX3H 9HFy9QhznYonVAU5PNucqD32zDMuas/oBFaQXDckPcy8N8FJC0YeBSzvoXIE9uQkuVwO TTzOXeogfxWafe49iONCJ7NozzN1fCnTtCA2XvG89dFEDdtFtpkARgoTDBLlg0HwWeV+ jiTA== X-Gm-Message-State: ALoCoQmJvlClegQKJ7vkMVig3dFU0sn5TPVhZbR36/6ttIPXV/94NL9aLnI4+xZESEPE/lXJdWPcXdvU+VsvCw/DoFw6VhCn/Q== X-Received: by 10.28.179.84 with SMTP id c81mr17974843wmf.30.1452581411235; Mon, 11 Jan 2016 22:50:11 -0800 (PST) Received: from localhost.localdomain (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id yz5sm70776886wjc.36.2016.01.11.22.50.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 22:50:10 -0800 (PST) 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?Matias=20Bj=C3=B8rling?= Subject: [PATCH 14/25] lightnvm: support multiple ppas in nvm_erase_ppa Date: Tue, 12 Jan 2016 07:49:28 +0100 Message-Id: <1452581379-18162-15-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452581379-18162-1-git-send-email-m@bjorling.me> References: <1452581379-18162-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=-6.8 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 Sometimes a user want to erase multiple PPAs at the same time. Extend nvm_erase_ppa to take multiple ppas and number of ppas to be erased. Signed-off-by: Matias Bjørling --- drivers/lightnvm/core.c | 4 ++-- drivers/lightnvm/gennvm.c | 2 +- include/linux/lightnvm.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 0c8f42f..cd674af 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -265,7 +265,7 @@ void nvm_free_rqd_ppalist(struct nvm_dev *dev, struct nvm_rq *rqd) } EXPORT_SYMBOL(nvm_free_rqd_ppalist); -int nvm_erase_ppa(struct nvm_dev *dev, struct ppa_addr ppa) +int nvm_erase_ppa(struct nvm_dev *dev, struct ppa_addr *ppas, int nr_ppas) { struct nvm_rq rqd; int ret; @@ -275,7 +275,7 @@ int nvm_erase_ppa(struct nvm_dev *dev, struct ppa_addr ppa) memset(&rqd, 0, sizeof(struct nvm_rq)); - ret = nvm_set_rqd_ppalist(dev, &rqd, &ppa, 1); + ret = nvm_set_rqd_ppalist(dev, &rqd, ppas, nr_ppas); if (ret) return ret; diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c index 12ddcaa..262da6d 100644 --- a/drivers/lightnvm/gennvm.c +++ b/drivers/lightnvm/gennvm.c @@ -396,7 +396,7 @@ static int gennvm_erase_blk(struct nvm_dev *dev, struct nvm_block *blk, { struct ppa_addr addr = block_to_ppa(dev, blk); - return nvm_erase_ppa(dev, addr); + return nvm_erase_ppa(dev, &addr, 1); } static struct nvm_lun *gennvm_get_lun(struct nvm_dev *dev, int lunid) diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index 9c9fe9c..a83298f 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -435,7 +435,7 @@ extern void nvm_addr_to_generic_mode(struct nvm_dev *, struct nvm_rq *); extern int nvm_set_rqd_ppalist(struct nvm_dev *, struct nvm_rq *, struct ppa_addr *, int); extern void nvm_free_rqd_ppalist(struct nvm_dev *, struct nvm_rq *); -extern int nvm_erase_ppa(struct nvm_dev *, struct ppa_addr); +extern int nvm_erase_ppa(struct nvm_dev *, struct ppa_addr *, int); extern int nvm_erase_blk(struct nvm_dev *, struct nvm_block *); extern void nvm_end_io(struct nvm_rq *, int); #else /* CONFIG_NVM */