From patchwork Tue Jan 31 12:17:12 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: 9547057 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 205A060425 for ; Tue, 31 Jan 2017 12:21:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11DEB280FC for ; Tue, 31 Jan 2017 12:21:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05CA628372; Tue, 31 Jan 2017 12:21:00 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 925F6280FC for ; Tue, 31 Jan 2017 12:20:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752027AbdAaMUn (ORCPT ); Tue, 31 Jan 2017 07:20:43 -0500 Received: from mail-bn3nam01on0058.outbound.protection.outlook.com ([104.47.33.58]:53760 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751943AbdAaMSF (ORCPT ); Tue, 31 Jan 2017 07:18:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cnexlabs.onmicrosoft.com; s=selector1-cnexlabs-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LXeeRv3G2In+Fqme46nTiHp5SFmwoDPtC15mPppmXO8=; b=hfNB2agfDe4jJ9JRdGNIhTYeHEQXrYIA96m//KGNdHdzIa1iBLcAFlFuNSvElVoXR7ebpL0PjQY8pvbmuhxXs+6zLqFEF4gv0Qos3l7zrB7VRiqhkBMDZtK4kueSactBOR6bDGA8KFFoMuh0lyOUS9KaJ0jP0X7GPbwlLob6+ZQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matias@cnexlabs.com; Received: from skyninja.cnexlabs.com (193.106.164.211) by DM5PR06MB2777.namprd06.prod.outlook.com (10.175.107.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12; Tue, 31 Jan 2017 12:17:51 +0000 From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: CC: , , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 04/12] lightnvm: remove nvm_get_bb_tbl and nvm_set_bb_tbl Date: Tue, 31 Jan 2017 13:17:12 +0100 Message-ID: <20170131121720.10971-5-matias@cnexlabs.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170131121720.10971-1-matias@cnexlabs.com> References: <20170131121720.10971-1-matias@cnexlabs.com> MIME-Version: 1.0 X-Originating-IP: [193.106.164.211] X-ClientProxiedBy: DB6PR0601CA0024.eurprd06.prod.outlook.com (10.168.88.162) To DM5PR06MB2777.namprd06.prod.outlook.com (10.175.107.139) X-MS-Office365-Filtering-Correlation-Id: d6d5bba9-946c-4fee-0d43-08d449d32dc7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM5PR06MB2777; X-Microsoft-Exchange-Diagnostics: 1; DM5PR06MB2777; 3:/PO7q5gd/6gS9EBHi5XpFgTooZGMin8eohmQaQaFjUaPMTxae7ISFyiueBvw1zVERywyrN7brbXTQBpDoHlSOCn8kHmuMfOsCM1XOQHDaJUefARxwz7b3eC9kLEXYuk8Ee2KuOXU4WU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YEU04EKujRFodyCL4ZwLOgHlVIsI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6042181)(6072148); SRVR:DM5PR06MB2777; BCL:0; PCL:0; RULEID:; SRVR:DM5PR06MB2777; X-Microsoft-Exchange-Diagnostics: 1; DM5PR06MB2777; 4:BOmTnZpAq780cS1f8FSqXw7t3mQzgr0XmjpkozenRwU3+D3AYX6kIETkIGnPB9e6RutCbcmkYMGlNl4tq2lczuZuTAAWVJB16/rivdV83MZnUqFj3xa4MYXKi/MV3Rkr1yIjqSwo75iw7Kdadq5T97QRmiyfS4JydViovcvftc+EirNxJ8UMzfYjhze5FKi6/0VWgJBJQloD2LuH6dAgm2+W1jSaIub/ffxm4t9Jc5F2hBrM2n9HnT4u5gffJD6apmoMmOY45t69sFVTEZlP2faBxP5lqvO/6tGvSiNgoXQdPzudVX62RCAh+XKB8TZHkWmwwV+l/L3yz5KUOCMJfqotCBGnb3WNC39vrDZNEyY826ONO8fsu1tywaNPOJRj8l8JHcKO4RHwOfixQwKVXxS6gsOXSyVT7OXcdnVu+I41heS70JJNYvHJr7qwW03PBnuhcRbRbaZfXoXrOURrbntth57HKWp1zgxgAIYpYSE63XGTknqpxN5oFGK/5BjUBvtHGWAOP8aQDEhuN8xl/6PxZmx/wmFTGtBm8hdTRuspbT5nMNOhN446qy5cTmwR/NbU8FgaiSaJCacftjMOZw== X-Forefront-PRVS: 0204F0BDE2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(42186005)(66066001)(50466002)(6486002)(47776003)(38730400001)(105586002)(54906002)(25786008)(106356001)(2351001)(36756003)(68736007)(4001430100002)(53416004)(50986999)(107886002)(7736002)(2906002)(305945005)(4326007)(110136003)(23676002)(2870700001)(189998001)(5660300001)(92566002)(86362001)(1076002)(6116002)(3846002)(33646002)(6916009)(97736004)(2950100002)(5820100001)(6666003)(76176999)(101416001)(53936002)(81166006)(81156014)(8676002)(50226002)(69596002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR06MB2777; H:skyninja.cnexlabs.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cnexlabs.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjA2TUIyNzc3OzIzOkdjQmdCaXJWUW5sSEFrMWIzU3BGTHRFaXhz?= =?utf-8?B?UXBzTFBqdkJvdjF6VDh2TWQxS3hzQ1l6dURsTmpJNUlrQ3FzVGFsZUNoWlND?= =?utf-8?B?WWxZOHZnSEZBUHdFdjhHaG5zcGdLVDI0MVYyOGxaeUhOM2NTM0VBWURXSDhX?= =?utf-8?B?K2s2eHVqRFZDaDdKOUczc0kyb05ZKzNpcERrRTRPYVFSZE9kWmZXMlBnLzEx?= =?utf-8?B?YU11RGQvcnk4OHkxeVpGS1RBcjIrMzVOYUVxYWZlemtiTllHR003VE4vQWhC?= =?utf-8?B?VkZjRkM4T2Rtb3p6Z2NMby9vU1MvRmR5TSsrdXJRT1B1MGJ1U2JnQThCeWNO?= =?utf-8?B?SmJEazhRNTU2NUU4eEh6dFZkTjM2SG5XSkdaUnZnSDl3ZG9XK0hZM1huRU9n?= =?utf-8?B?aUw2MjFnUTZKZVFjWWdBbjRqRnp2T1BHTzdzZnJ4cHYzbjRucWo3bHZocDZR?= =?utf-8?B?ZHVieVlLMTN5WjltTHFTdUZFd0J2OGVNSDhRMlljb0hTdGtmNDhoanRBY0di?= =?utf-8?B?djFEL3BkWmk2UTE4dU5HLzJMWEVNYTNOQ003dGtYT2hBYjJuM2U3QVJFTm9s?= =?utf-8?B?WGlLVjVwVm1NaU4vZkptQWh4eGd1aUJ0UVlUdHlWRVhQSk4rTXZNTTF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ZTeVFaZHpISktQUVRBTjBq?= =?utf-8?B?eExnclFzMFhtT1pIRnVqRUs1NTN5aDlKRlk1UldFUTFjakw1SHJScU9Yb1k5?= =?utf-8?Q?uiCxJcMf1rPzZd5BXrmV?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR06MB2777; 6:un8tmLEdpdJ/ztTv3OINcPAw7Q1mA5tyfeCHlRid2iHemQnA5KL4TN53KqffGN9kRwMkpLa8y2RiGXfHLQrm9bO7WoSkWijD0e3ommfTsMwGEEX0zEC8cIFgeu+2bcLprynRtbbNj99KGQiCiEzrDFRUGk9ByP8aRYtPfI05UsAHrH/7cyHnHmERXKTtqlyFc726xU+tz+A5nWfR5t+3XZTJcWFF6OexZLkGvSJuG55gji0kAs4Ucxz531ODCx7etePQqFl3ksdybDVYvUpz8TpIsXDWiihaA6dDc42dr3Eucsa2aBt+Y7ElS4Fx3+4Axvv9Lq46tIhtL1v4IQl523srBQQpiT0x6hisT5dhA2kgXsoScpzCZSKxZKVZcz8JCxhEWO0Idi/Dk0r2M+FiIValaAST9fUpiv5Q1QkxKH8=; 5:ZGKRAigERN1KOg+7eHWe47Qp2a+9CW870c9jFC+pdy8jvtIlQmJXXaN2sm4Xp4tki/YCLzL8vBlX/pn1y3vsCE9HuFrgO2+E1geyNn7jrpQCELn6skw2nOsRUJJOPgVnLi/kcwy5YVwqNpGVk0mfkQ==; 24:ZHRe062gW1UokWoleyZKXqZmNemqGj46JjPpp00jCmw9n6sIpjyMbMh0baD2PiyGNF9yc+5DpHE7b5wrmzGAOzog9Acv+L5EH9KFpHbQT2Y= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR06MB2777; 7:DK4kxiixpt6MW9998H2eCeyxy7wJFYesUy0HI7kYECb2y4xEpT88831jIP10eX+hm56vVvfGdjufw0m2kHa3KacyJLXn5+dz4HepVrF2SKXs+ZbbM2NjQYPweaPxxjK29ptXEmuUk6tYIWoTmKCYHUjOvKdLzApbv1AW5K18LBo5N8X/XRl5Bbuuz9ZwKoMSkZjQCAMiasXUcCo3vkRuc5zuwg9g7DhN8xuUtK/+zM7gxt0ByL4MagGXAArs9d5lcXqCqYIlrnfPBuBVuYPAEGfdKo6gin8Li/HrQ3ty6imRnyRuYVIWBm8OnPjUuF2Ao3bpDzSQJwBPT9pVN4dLX+jwNy8OeebuZ4VkTlhS0CygEIZxvuW8RNDZU16SMZnR9lqLi7vZ3PBoiwBDWhZODbddb6B4PVa/+NWnq3e1zGgQ09idLmdTVMHt/oUrmBKRUUBBHpZuuQtMZKPDGzPLglW0XHs5WBKhzdCMkgHxILX+OHJMOoWPKmdR3GqEk0UCzSh+TOREhwuu62W2p5zM5z2F2IrPROkVaeBzfFc6e5AOhWc2RusP/2Ga7tB8IH1R X-OriginatorOrg: cnexlabs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2017 12:17:51.2742 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR06MB2777 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);