From patchwork Wed Feb 15 15:25:33 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: 9574297 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 0E4FB60493 for ; Wed, 15 Feb 2017 15:26:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1D9E281F9 for ; Wed, 15 Feb 2017 15:26:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6EE8284F6; Wed, 15 Feb 2017 15:26:19 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham 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 45C0D281F9 for ; Wed, 15 Feb 2017 15:26:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751023AbdBOP0S (ORCPT ); Wed, 15 Feb 2017 10:26:18 -0500 Received: from mail-bn3nam01on0043.outbound.protection.outlook.com ([104.47.33.43]:3526 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751573AbdBOP0N (ORCPT ); Wed, 15 Feb 2017 10:26:13 -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=gYX8VXhQzPRsyRVfbgBkDfvwLmyF4bQBrMefBMziizE=; b=H1zicy/NGIiGhJOC1vDSvpksPUlqNekUeF9fuBukeX/Nd+7AeRwtarIiEjgx1kZIrmjVZuWiK7tUaoU/y5HQ2JpcoGsR0IqOQ6J1Gf3ACEszfftw/3RHmBpJ6zJRpFVx6fhAZV7rD7Mc54nHagQ427U8TkIRNSWqH7PidapC7Wc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matias@cnexlabs.com; Received: from skyninja.cnexlabs.com (193.106.164.211) by BN6PR06MB2769.namprd06.prod.outlook.com (10.175.127.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 15 Feb 2017 15:26:10 +0000 From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: CC: , , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 2/2] lightnvm: set default lun range when no luns are specified Date: Wed, 15 Feb 2017 16:25:33 +0100 Message-ID: <20170215152533.9712-3-matias@cnexlabs.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170215152533.9712-1-matias@cnexlabs.com> References: <20170215152533.9712-1-matias@cnexlabs.com> MIME-Version: 1.0 X-Originating-IP: [193.106.164.211] X-ClientProxiedBy: HE1P195CA0009.EURP195.PROD.OUTLOOK.COM (10.171.121.19) To BN6PR06MB2769.namprd06.prod.outlook.com (10.175.127.11) X-MS-Office365-Filtering-Correlation-Id: 8d987a08-07d8-4e78-dd46-08d455b6f8f6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN6PR06MB2769; X-Microsoft-Exchange-Diagnostics: 1; BN6PR06MB2769; 3:qKM0w0hgRyklTo7dejYOi+HHj6ztmMIZvKMLUwVnXHkQ1Hik+2uwVOc2cNY8Fha7fwxqTc44UjPUVtCWIhuto34dDy0OB7+BicQCT0rdZHc552ZYZ9dSa3cI0hG3blgCTPUIuBEnUoOjfPYC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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)(20161123558025)(20161123555025)(20161123562025)(20161123564025)(6072148); SRVR:BN6PR06MB2769; BCL:0; PCL:0; RULEID:; SRVR:BN6PR06MB2769; X-Microsoft-Exchange-Diagnostics: 1; BN6PR06MB2769; 4:F3h9wS+RDLsWn8dzZfCUcVQ/78UgllNARsJS8CzyVzHiuoKlBMv74uYR4VzB6XK4xEx79VJPYisrj5mnvH4SopBvxnhSXEaqVbqWSOYkt0VnBKrwQJSyJSoMU3dsvV4//ziUz/y383g7ku2V2k+qPPainyNTAmLUVTHGSk+32Mm8L2hkptg+YegiRpRBUocIQaGyjaysYzJpzqHwsNV1QWTQaHGri8G3dmz2gD8T5APVt5EORdX2CtAwxadLTNtjKWL/5nMEk1/12Ou2x6v3orRq/GdngblmnTwsh6wFgPpl+e1KrOdwSc97rwA/Wkk5aVNuamcW/3Ngu+9WX9bbyCIEKCX1g6VI/riaP/XHcW+9vbx00Vmz9v+lPHlnWGNeqdPM2BISiGNaEHRcs6J3wW+VHhoyJrPYkWqUZtfs6PRr9IDmEsCqqDCRS3b6DSLVVt8F5Ya7PucpkEoImEr21IS+W9errC7vsKuHL0DJCKsfw0azunVr8KFguM8ZZvvCOLZUjUsoDMHub3yKysGF29kkoR4A7f6HjrryXWTSiaFpozC32AA0Nux5NjBSFMg/LYYI72IIY43AcdjvlCUMUpVZVYGj3biQWIZF/wJ2m0E= X-Forefront-PRVS: 021975AE46 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(189002)(199003)(106356001)(6916009)(6666003)(2351001)(1076002)(66066001)(105586002)(2950100002)(2870700001)(54906002)(36756003)(53416004)(4326007)(5820100001)(50466002)(8676002)(2906002)(81156014)(86362001)(389900002)(33646002)(189998001)(6116002)(81166006)(47776003)(25786008)(50226002)(110136004)(50986999)(53936002)(7736002)(305945005)(42186005)(76176999)(6486002)(107886003)(3846002)(38730400002)(68736007)(23676002)(97736004)(101416001)(5660300001)(92566002)(69596002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR06MB2769; 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?MTtCTjZQUjA2TUIyNzY5OzIzOjFYNWduaXpjdFZPdURMUWFWSVJ5Z0RqRVJ3?= =?utf-8?B?MGxxd28zek5ZNlB6WFBQVWNIdVlwUWlWN3F4a2tJNnFyb2JVdU5xZmZVL21X?= =?utf-8?B?cC9zYUFvbm9aVXpTNWxXR0poNkNIek5RU2o1eWVJZWdORURuR015V3F1ZnZi?= =?utf-8?B?VC8zSVA2WG4rQWdjOEsvazRSWGEvbU1qT0VZQzByVmRMeHpqVW9kTmVRdUNv?= =?utf-8?B?dENJc295a1lYb0dsSXIrd1NFUDhhRWk4TWo5ZlFOUFBxcDFSQVdhWWJmV0pu?= =?utf-8?B?dGduZ3FtcWFJem5tdDQ0ajNaMmkzU3pJWmxISkdFZXBEaUlQNVlCZ3NNTVps?= =?utf-8?B?MUJHL3FSU3NCaEpKR0xwRkNQVFlIQXNVK05pSXFUL0p2UU9sZExydHdiNmd1?= =?utf-8?B?aE9aQlc3QzBLYnBJZWJaY3g3UmdRZW1hTHFabUZIdzhxWCtUNmtBNVFwaW1J?= =?utf-8?B?UC9sUkVxTW9DRnl3a2FuTW9MenAzZmJIZEszOUEwTkJvWWdDWnpYQjFUTHU0?= =?utf-8?B?ekRzVGJyWUsyUER2T3Y4T0JBZHg1djJhaWhZbm9hMHNZNm9vd0dmRU5IbUlu?= =?utf-8?B?cCsrdjRoVG0yQ3BrY2RWMElqVHM2cVNZbVloRmgzRU1MWjBMdjZVRC9YUjY0?= =?utf-8?B?T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opjDGcT+jHL5PWHf9EbnU6ERF7re48ybssPYSktLKeg74i9uLWkvKS2Yyz0KtVFpHNEdIxcPyzCI3XBUKlpI6g9xCkOIecVrt5bShjQ1nDJfO2Yxxz231dHLuLHOAJCAPonreylLDeH/aV6hRoBJCZJ9E2+qF4Q3C8g0fRSvJg9yvJ12INYqivuu5DLtG615d71Ret/6s/jWuXXaapSWPgzxEPs4IIkP6HuTIQKxwWxp2XAe7pQIqhUw9nBA2KnzY+FaOA5NC+VOa2s+eEJ7H1AYunij0262p9VTQWBjmXlgYcG6fDl+FOhe5BgC7IIyrZuAKrd9XGVCQC2S2J/4LM2dMbobKA7JiMktzTRnUPdJ/I9+AHZ4UeiSdA/69MV2HI/g5EkqALbpDmobog== X-OriginatorOrg: cnexlabs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2017 15:26:10.7512 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR06MB2769 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 The create target ioctl takes a lun begin and lun end parameter, which defines the range of luns to initialize a target with. If the user does not set the parameters, it default to only using lun 0. Instead, defaults to use all luns in the OCSSD, as it is the usual behaviour users want. Signed-off-by: Matias Bjørling --- drivers/lightnvm/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 6ce76c0..5262ba6 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -1102,6 +1102,11 @@ static int __nvm_configure_create(struct nvm_ioctl_create *create) } s = &create->conf.s; + if (s->lun_begin == -1 && s->lun_end == -1) { + s->lun_begin = 0; + s->lun_end = dev->geo.nr_luns - 1; + } + if (s->lun_begin > s->lun_end || s->lun_end >= dev->geo.nr_luns) { pr_err("nvm: lun out of bound (%u:%u > %u)\n", s->lun_begin, s->lun_end, dev->geo.nr_luns - 1);