Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4624842ooa; Tue, 14 Aug 2018 08:22:42 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw2RrdDK6bBbFxbabtHhISF3lrAQ+8xAheZu9d1VyuZrJ8x6WP4JKggzNF4NYA7hhVNomCZ X-Received: by 2002:a17:902:c6:: with SMTP id a64-v6mr18649807pla.180.1534260162834; Tue, 14 Aug 2018 08:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534260162; cv=none; d=google.com; s=arc-20160816; b=Az1fQK5w6GZDRhyngp1c0xf0wDGLDmaTFJ/uKVV74vbtxB26TmchPdJ5dP2pnQ9gh1 zH/LE/ftqceu5bk2LSfMQHGq0A+2/eIOHC2W+NwMNcKo2SaGaC4ecRU5mmI3koEfDcD1 RCS+4sgy0B7Rz8DxtuHjZoDjXJkYhDco+gLPilk2aEaFJAKbZYwPQ5wEbTkUjllF9hzm kD+P+NgwZo2vaSYZ7KMjKXxAamVda4UO9N8QZKVw3wBlLDSJS6jCcTV9KEZQ0g7m92cC Tg31PAJI7sfb/iFLunG76d3vAHWAH6gxAU/LDUZoUrg4KPAVSI6toP4X6AtI0ET9vR+a S3Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :wdcipoutbound:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:subject:cc:to :from:dkim-signature:dkim-signature:arc-authentication-results; bh=8JaG/dtoU40qoO/FkkfIjG251JhsFRyBEihyxkqrX3g=; b=X1r6fVA61nfAyU1/7euVdrMSaiDxRT1zGt7ZsHsutBrKo/NK+KKet7SQsas5eXyx2y NXZ12pByys+kb1BNlL2gFpa8rajNa6V1lTHJTFDyLnf6uMrLdB3LV9mh8WUtnuSsmXiN zMQ1XYdrAYtDL7sTa4hTGAw63UWT4zrm5SBBexIhMqRBYzSgyGQMKCZnEfgM7NtUXdjy TxAC1e45NA93Ykzf5Z3oeSIao76PQA/QAmaa1tH2mbyJnQhh3QF5txSTCq8HyiF2HBRe fRzKicMrbr6jM5XaC95HEDjNGchANhYnI1lof1TdedFkSbaRFgk/LQrxeV3gNOwaKjPf vrjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=mcgIQTA8; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector1-wdc-com header.b=b3Kp5Hvs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e21-v6si19388281pgl.148.2018.08.14.08.22.27; Tue, 14 Aug 2018 08:22:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=mcgIQTA8; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector1-wdc-com header.b=b3Kp5Hvs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732578AbeHNSJJ (ORCPT + 99 others); Tue, 14 Aug 2018 14:09:09 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:45571 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730759AbeHNSJI (ORCPT ); Tue, 14 Aug 2018 14:09:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1534260093; x=1565796093; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=r0OGpG8lxscJmR7zPs1TMQ7hvDd+vAkBGhGeqEiYgjw=; b=mcgIQTA894k0ABxy8QzAvj6wdi6SsxcqE6nKZidb4AKLOzVVabpETXSX 2t1Yq+KIRY7rp0MhQCqxWl8QUcWLHJrAwH6f6CSeYcBLdxszsGmX5V2PK zViEQ94XujD73vgpVAPQyMKxwdN3w4H8P5NQF0o0jma1TIXC4Myh+qyJe 382pEC4HI0LaOJa3StPZvV9q3gcYTuNUUgIWKSW18M9cpe5Jl7eh+8m1O dQBa88dzy1jPehpr4umplLXQgry3e3AtkucDqvU/W56QjdTqsPTy5XHwD O5j3/TX66EPK4YUSCossx+gTkmlroYhc58KmkyV/2ToglFbZn2HHMYcA6 w==; X-IronPort-AV: E=Sophos;i="5.53,238,1531756800"; d="scan'208";a="89048047" Received: from mail-bn3nam04lp0117.outbound.protection.outlook.com (HELO NAM04-BN3-obe.outbound.protection.outlook.com) ([216.32.180.117]) by ob1.hgst.iphmx.com with ESMTP; 14 Aug 2018 23:20:36 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8JaG/dtoU40qoO/FkkfIjG251JhsFRyBEihyxkqrX3g=; b=b3Kp5Hvsq++ve7JaJbp3hDzfmGA+IArsyMA2wxtEKMs4XYK+7VNdnO8j7xDaYJozHdpDcs0nu4XNrI9PsmS4GjjFWXNmwdoWceQRr7beVE2n4RAz2ekfJP9LcJ87pC2Yoi2HugNRezmjFqf1SnANbBfGeP/IwqhrAvZxfyjQ+S0= Received: from MWHPR04MB1198.namprd04.prod.outlook.com (10.173.48.151) by MWHPR04MB0494.namprd04.prod.outlook.com (10.173.49.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.23; Tue, 14 Aug 2018 15:20:33 +0000 Received: from MWHPR04MB1198.namprd04.prod.outlook.com ([fe80::855a:8758:5f65:f8ee]) by MWHPR04MB1198.namprd04.prod.outlook.com ([fe80::855a:8758:5f65:f8ee%9]) with mapi id 15.20.1038.023; Tue, 14 Aug 2018 15:20:33 +0000 From: Bart Van Assche To: "hare@suse.de" , "axboe@kernel.dk" CC: "hch@lst.de" , "linux-kernel@vger.kernel.org" , "keith.busch@intel.com" , "linux-nvme@lists.infradead.org" , "linux-block@vger.kernel.org" , "hare@suse.com" , "sagi@grimberg.me" Subject: Re: [PATCH 2/5] nvme: register ns_id attributes as default sysfs groups Thread-Topic: [PATCH 2/5] nvme: register ns_id attributes as default sysfs groups Thread-Index: AQHUM6ES3j1v2YHkvU2ZLaLIQP27MKS/XWuA Date: Tue, 14 Aug 2018 15:20:33 +0000 Message-ID: <5a4aab8b5f509d8090ad10107b01d11285fe1528.camel@wdc.com> References: <20180814073305.87255-1-hare@suse.de> <20180814073305.87255-3-hare@suse.de> In-Reply-To: <20180814073305.87255-3-hare@suse.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bart.VanAssche@wdc.com; x-originating-ip: [199.255.44.174] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR04MB0494;20:0m9q3AXmoYDx0LabHjn29RPuM1Ze5D20or+thLBvzL91dm79q6+u9TEoSidas5QgxZZD2uMblc9LA6hKmM7DooPzTcJLtxc3i5roI/0DFCfFwl6snjlLoDcxOXYtDUlKoUo1O8qLX2TMZbl18FlbXNGwvtAIQ2ZDVfgVvCxlP68= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: b4eed62f-95a6-4da0-932d-08d601f97a8a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:MWHPR04MB0494; x-ms-traffictypediagnostic: MWHPR04MB0494: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:MWHPR04MB0494;BCL:0;PCL:0;RULEID:;SRVR:MWHPR04MB0494; x-forefront-prvs: 0764C4A8CD x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(396003)(366004)(136003)(346002)(376002)(189003)(199004)(81166006)(6506007)(6486002)(8676002)(478600001)(106356001)(102836004)(6436002)(66066001)(2501003)(54906003)(110136005)(3846002)(86362001)(8936002)(5250100002)(81156014)(68736007)(105586002)(2900100001)(118296001)(99286004)(25786009)(446003)(6116002)(76176011)(97736004)(2616005)(229853002)(476003)(11346002)(7736002)(305945005)(26005)(316002)(53936002)(14454004)(6512007)(256004)(186003)(6246003)(5660300001)(486006)(4326008)(36756003)(72206003)(2906002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR04MB0494;H:MWHPR04MB1198.namprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; x-microsoft-antispam-message-info: 6jsJblm3sXCe1ZkiMQ9SoxzySVdv1I6fwxsGkaZoWCPzEBN/Ojm9ZxMq8Q0BEYc2tDmnSMT3P6UMk9M7+z0alAC5vdSRRt7o2gJNaq4szOHrHMKfT7MZ4YGJR+o2QFJ0YO1rY9rDoeejmFVpUqYK4GRpqQ23f16nAMjx7YNW6UD2LA2UCfhwYeTzARVD8ZcBXm3aZWvug5ctpx+DAsRDeufHa6wKFKxv98kJYHFkCIpQs8ZqURXldzlIZz6vcB0cgq1wHrdGuJWyHORje7t/FBewKYhs4ByfFNcqePohhB9Y1SqGAwsR2x8ZypiwrN4Q7j2MLEhVgPA5k/PVOcZajfXxN/IcWR6TRNUokuHkm4o= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-7" Content-ID: <5A54610DA131A247A51F840B314FD428@namprd04.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4eed62f-95a6-4da0-932d-08d601f97a8a X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Aug 2018 15:20:33.2208 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR04MB0494 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-08-14 at 09:33 +-0200, Hannes Reinecke wrote: +AD4- +-const struct attribute+AF8-group +ACo-nvme+AF8-ns+AF8-id+AF8-attr+A= F8-groups+AFsAXQ- +AD0- +AHs- +AD4- +- +ACY-nvme+AF8-ns+AF8-id+AF8-attr+AF8-group, +AD4- +- NULL, /+ACo- Will be filled in by lightnvm if present +ACo-/ +AD4- +- NULL, +AD4- +-+AH0AOw- +AFs- ... +AF0- +AD4- -void nvme+AF8-nvm+AF8-unregister+AF8-sysfs(struct nvme+AF8-ns +ACo-n= s) +AD4- -+AHs- +AD4- - struct nvm+AF8-dev +ACo-ndev +AD0- ns-+AD4-ndev+ADs- +AD4- - struct nvm+AF8-geo +ACo-geo +AD0- +ACY-ndev-+AD4-geo+ADs- +AD4- +- return+ADs- +AD4- =20 +AD4- switch (geo-+AD4-major+AF8-ver+AF8-id) +AHs- +AD4- case 1: +AD4- - sysfs+AF8-remove+AF8-group(+ACY-disk+AF8-to+AF8-dev(ns-+AD4-disk)-= +AD4-kobj, +AD4- - +ACY-nvm+AF8-dev+AF8-attr+AF8-group+AF8-12)+ADs- +AD4- +- nvme+AF8-ns+AF8-id+AF8-attr+AF8-groups+AFs-1+AF0- +AD0- +ACY-nvm+= AF8-dev+AF8-attr+AF8-group+AF8-12+ADs- +AD4- break+ADs- +AD4- case 2: +AD4- - sysfs+AF8-remove+AF8-group(+ACY-disk+AF8-to+AF8-dev(ns-+AD4-disk)-= +AD4-kobj, +AD4- - +ACY-nvm+AF8-dev+AF8-attr+AF8-group+AF8-20)+ADs- +AD4- +- nvme+AF8-ns+AF8-id+AF8-attr+AF8-groups+AFs-1+AF0- +AD0- +ACY-nvm+= AF8-dev+AF8-attr+AF8-group+AF8-20+ADs- This patch introduces a really ugly dependency between the NVMe core code a= nd the lightnvm code, namely that the lightnvm code has to know at which posit= ion in the nvme+AF8-ns+AF8-id+AF8-attr+AF8-groups it can fill in its attribute = group pointer. Have you considered to make nvme+AF8-nvm+AF8-register+AF8-sysfs() return an attr= ibute group pointer such that the nvme+AF8-ns+AF8-id+AF8-attr+AF8-groups can be changed= from a global into a static array? Thanks, Bart.