From patchwork Mon Jan 23 11:59:15 2017 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: 9532357 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 5B56360434 for ; Mon, 23 Jan 2017 12:01:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EB892833A for ; Mon, 23 Jan 2017 12:01:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32B1828342; Mon, 23 Jan 2017 12:01:54 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D45C72833A for ; Mon, 23 Jan 2017 12:01:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751207AbdAWMA1 (ORCPT ); Mon, 23 Jan 2017 07:00:27 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35340 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750997AbdAWMAU (ORCPT ); Mon, 23 Jan 2017 07:00:20 -0500 Received: by mail-wm0-f66.google.com with SMTP id d140so25934386wmd.2 for ; Mon, 23 Jan 2017 03:59:46 -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-transfer-encoding; bh=U9X5257mqFW5eR8TR3Ku4OzHU7DdIYAHERpMuQro74A=; b=jV1c6lB2/3LBcRE2XyB6/Q9DPxSCsQcLfS0l+c4tjxaCM/Phl8X2UEn/EEiXDkMfaw ZWmxeH3LtbVQPuAIJPjcCwQZAwsSDfjb1tjXlAYZAxrYfy3Kwz6+8E8sJkKNwXfksv/9 QN4lV+uL5FOLGrvDbsW83xtbgsYkT9GO1udz8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U9X5257mqFW5eR8TR3Ku4OzHU7DdIYAHERpMuQro74A=; b=eCrovrfOH81In9j6Cq6kItEEJDKQQZvTJGwXo4GW4Kh7LvtnU42d1hfMf2j0opapT/ vow78PaVBg4KbLIarhFap1sN/iHHCrfPzR/GINknVbZ3O6J/Bnwq2MuAx3PGqtucni0S xT7fcLdOvsO9DIH+JsSQIjXyFHY9kKmav4XZ+hckhXbJC56cIu46OxJu511BjTO+JdNj 4HZYin3xzwVn5LkDrmEz0mK8vYBrTUwumeohprCkTL9s4A+4IKiL5NRyG7qiymyZEZPt 0TjBDIVYmS6EKUqo/u2sMARXH+b4d2SQoWeLoaJURFSzDwD+WmbHH8M7j8tQmaggWCjD 9igQ== X-Gm-Message-State: AIkVDXKdhmz9LjaxT/spglzehdPSizP6aR7a83l+DJVezJb5HPkiG4x8LBDlGksUxj/qZQ== X-Received: by 10.28.46.74 with SMTP id u71mr12537230wmu.136.1485172785899; Mon, 23 Jan 2017 03:59:45 -0800 (PST) Received: from skyninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id x135sm20715381wme.23.2017.01.23.03.59.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jan 2017 03:59:45 -0800 (PST) From: "=?UTF-8?q?Matias=20Bj=C3=B8rling?=" X-Google-Original-From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 4/8] lightnvm: remove nvm_get_bb_tbl and nvm_set_bb_tbl Date: Mon, 23 Jan 2017 12:59:15 +0100 Message-Id: <20170123115919.14339-5-matias@cnexlabs.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170123115919.14339-1-matias@cnexlabs.com> References: <20170123115919.14339-1-matias@cnexlabs.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since the merge of gennvm and core, there is no longer a need for the device specific bad block functions. Signed-off-by: Matias Bjørling --- drivers/lightnvm/core.c | 40 ++++------------------------------------ include/linux/lightnvm.h | 2 -- 2 files changed, 4 insertions(+), 38 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index ffdf048..18d4873 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -605,33 +605,6 @@ static void nvm_tgt_generic_to_addr_mode(struct nvm_tgt_dev *tgt_dev, } } -int nvm_set_bb_tbl(struct nvm_dev *dev, struct ppa_addr *ppas, int nr_ppas, - int type) -{ - struct nvm_rq rqd; - int ret; - - if (nr_ppas > dev->ops->max_phys_sect) { - pr_err("nvm: unable to update all sysblocks atomically\n"); - return -EINVAL; - } - - memset(&rqd, 0, sizeof(struct nvm_rq)); - - nvm_set_rqd_ppalist(dev, &rqd, ppas, nr_ppas, 1); - nvm_generic_to_addr_mode(dev, &rqd); - - ret = dev->ops->set_bb_tbl(dev, &rqd.ppa_addr, rqd.nr_ppas, type); - nvm_free_rqd_ppalist(dev, &rqd); - if (ret) { - pr_err("nvm: sysblk failed bb mark\n"); - return -EINVAL; - } - - return 0; -} -EXPORT_SYMBOL(nvm_set_bb_tbl); - int nvm_set_tgt_bb_tbl(struct nvm_tgt_dev *tgt_dev, struct ppa_addr *ppas, int nr_ppas, int type) { @@ -919,20 +892,15 @@ int nvm_bb_tbl_fold(struct nvm_dev *dev, u8 *blks, int nr_blks) } EXPORT_SYMBOL(nvm_bb_tbl_fold); -int nvm_get_bb_tbl(struct nvm_dev *dev, struct ppa_addr ppa, u8 *blks) -{ - ppa = generic_to_dev_addr(dev, ppa); - - return dev->ops->get_bb_tbl(dev, ppa, blks); -} -EXPORT_SYMBOL(nvm_get_bb_tbl); - int nvm_get_tgt_bb_tbl(struct nvm_tgt_dev *tgt_dev, struct ppa_addr ppa, u8 *blks) { + struct nvm_dev *dev = tgt_dev->parent; + ppa = nvm_trans_ppa(tgt_dev, ppa, TRANS_TGT_TO_DEV); + ppa = generic_to_dev_addr(dev, ppa); - return nvm_get_bb_tbl(tgt_dev->parent, ppa, blks); + return dev->ops->get_bb_tbl(dev, ppa, blks); } EXPORT_SYMBOL(nvm_get_tgt_bb_tbl); diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index abb3d55..cad1e1c 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -473,7 +473,6 @@ extern struct nvm_dev *nvm_alloc_dev(int); extern int nvm_register(struct nvm_dev *); extern void nvm_unregister(struct nvm_dev *); -extern int nvm_set_bb_tbl(struct nvm_dev *, struct ppa_addr *, int, int); extern int nvm_set_tgt_bb_tbl(struct nvm_tgt_dev *, struct ppa_addr *, int, int); extern int nvm_max_phys_sects(struct nvm_tgt_dev *); @@ -490,7 +489,6 @@ extern int nvm_get_area(struct nvm_tgt_dev *, sector_t *, sector_t); extern void nvm_put_area(struct nvm_tgt_dev *, sector_t); extern void nvm_end_io(struct nvm_rq *, int); extern int nvm_bb_tbl_fold(struct nvm_dev *, u8 *, int); -extern int nvm_get_bb_tbl(struct nvm_dev *, struct ppa_addr, u8 *); extern int nvm_get_tgt_bb_tbl(struct nvm_tgt_dev *, struct ppa_addr, u8 *); extern int nvm_dev_factory(struct nvm_dev *, int flags);