From patchwork Wed Feb 21 09:26:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= X-Patchwork-Id: 10231637 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 B651960392 for ; Wed, 21 Feb 2018 09:29:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC4F528AA6 for ; Wed, 21 Feb 2018 09:29:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE46028AAA; Wed, 21 Feb 2018 09:29:53 +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=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 43B6D28AA6 for ; Wed, 21 Feb 2018 09:29:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753164AbeBUJ13 (ORCPT ); Wed, 21 Feb 2018 04:27:29 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:37047 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932105AbeBUJ1X (ORCPT ); Wed, 21 Feb 2018 04:27:23 -0500 Received: by mail-wr0-f196.google.com with SMTP id z12so2447814wrg.4 for ; Wed, 21 Feb 2018 01:27:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Cqz8IkN9M9pueVJavtdevg20WbJoy5XfdFEDgJqUCgI=; b=0JBqN7iwpx4TyV2+qrCGyx2T6Gtqgzw5HzqpRtEgMhHvBFCoHg4n8DlcG5je+52wFV Ekxr284W75JJ4L5e6VUBjyLSgkP9ogqiydo+rA86KfDuZr+pRkB5v2nnv7Q6iRITcc94 q4Fh/rJIKlm/vTObB2uqQdcU/YkdIdOFPWz6Kq7Qj8Ek9nFPmIsGbf1zTTpgxqIBa3Cc d5fViNfFtHqtbKrrk+Zhhr4a/mXQk4QTzzVcr35N5sVHJWX9wdm8F4kMYiRww8IVjw59 K8/DM/vRf7msI/zFuctW5rCpNiNqIEVkxJOCwogxWCliWkcMiKjhrypUulh4HzRScE8l U+HQ== 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=Cqz8IkN9M9pueVJavtdevg20WbJoy5XfdFEDgJqUCgI=; b=dnQd9kXOXOp3ykW8/A6gOB+JwTnW3dpvOUcWLYv8p5R5BZgJws9cQAmc/yb+7P3Xg4 TYLAEp4cm+QKTFgsV/oOj+9IpicJv5h0hP7hc7wIEItxCzV/p8agaMRHYEhqFTXfEYch A+zGvZXAe/+XNep2EUsLEt5Y9qCgBXaC2MzFie1tFHPQYJmOYMGniylYPAzxluRAW9mA szCvSVsth8i4RqtQw6D6wrXVD3GMsp0CgFVkGw9MuVr7GzdMXPj/sLnoGHLqDRhql/dB ksx2l43YNK4SJjBxZ4C6oWdNdGgdHi76xu+sISXBc0Ln9wjMEzuUf2DCPYmTmX67GgdZ cMVg== X-Gm-Message-State: APf1xPC9cNVC/FxejzwsavYRjohktuxv85b6HvzvQwJCIhFJ9dnjUtcz NdYUanMYkarwEN/FbJZTeF+iPg== X-Google-Smtp-Source: AH8x225zdJDV+pGJyM4eLJWhg5j6kWOFUcR56+Vofx8XF6M74WmSHPD4Q9BPa6re9/MrW9jJg+QJAg== X-Received: by 10.80.144.173 with SMTP id c42mr4091410eda.299.1519205242146; Wed, 21 Feb 2018 01:27:22 -0800 (PST) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id a17sm3389955eda.42.2018.02.21.01.27.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Feb 2018 01:27:21 -0800 (PST) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH 12/20] lightnvm: complete 2.0 values in sysfs Date: Wed, 21 Feb 2018 10:26:50 +0100 Message-Id: <1519205218-26994-13-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519205218-26994-1-git-send-email-javier@cnexlabs.com> References: <1519205218-26994-1-git-send-email-javier@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 Add missing geometry values to sysfs. Namely, maxoc and maxocpu. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index 70dc4740f0d3..88c71d0d0d8c 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -1059,6 +1059,10 @@ static ssize_t nvm_dev_attr_show_20(struct device *dev, return scnprintf(page, PAGE_SIZE, "%u\n", dev_geo->c.ws_min); } else if (strcmp(attr->name, "ws_opt") == 0) { return scnprintf(page, PAGE_SIZE, "%u\n", dev_geo->c.ws_opt); + } else if (strcmp(attr->name, "maxoc") == 0) { + return scnprintf(page, PAGE_SIZE, "%u\n", dev_geo->c.maxoc); + } else if (strcmp(attr->name, "maxocpu") == 0) { + return scnprintf(page, PAGE_SIZE, "%u\n", dev_geo->c.maxocpu); } else if (strcmp(attr->name, "mw_cunits") == 0) { return scnprintf(page, PAGE_SIZE, "%u\n", dev_geo->c.mw_cunits); } else if (strcmp(attr->name, "write_typ") == 0) { @@ -1158,6 +1162,8 @@ static NVM_DEV_ATTR_20_RO(chunks); static NVM_DEV_ATTR_20_RO(clba); static NVM_DEV_ATTR_20_RO(ws_min); static NVM_DEV_ATTR_20_RO(ws_opt); +static NVM_DEV_ATTR_20_RO(maxoc); +static NVM_DEV_ATTR_20_RO(maxocpu); static NVM_DEV_ATTR_20_RO(mw_cunits); static NVM_DEV_ATTR_20_RO(write_typ); static NVM_DEV_ATTR_20_RO(write_max); @@ -1175,6 +1181,8 @@ static struct attribute *nvm_dev_attrs_20[] = { &dev_attr_clba.attr, &dev_attr_ws_min.attr, &dev_attr_ws_opt.attr, + &dev_attr_maxoc.attr, + &dev_attr_maxocpu.attr, &dev_attr_mw_cunits.attr, &dev_attr_read_typ.attr,