Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5591325pxj; Wed, 23 Jun 2021 04:55:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydvTlL0wFj3gSpiUb4QaWukXqxCjzivnCE7uCUZotB60kezyM7JlvQ2p+R/yj8tPfMQrs6 X-Received: by 2002:a02:914a:: with SMTP id b10mr8578765jag.59.1624449357565; Wed, 23 Jun 2021 04:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624449357; cv=none; d=google.com; s=arc-20160816; b=vhVP06HJ1QyR2m7JheibbRJR57+d6+29HW0Gh9++1sTHrhs1zapbT1aOMFCCSh2xcs NkGwG22X9mLtVV0eP65UpuBwLlVEUCSyvbx1anxLo9xy+gCwEx+ccNWRDmi6aQ3+jzqw eavdqTBB/DWLvD03uBIkIVnwfgilmhe/BzWUnrpuKjTooxduECkKkItaR10z8ghwbr4P Kq0os6Wlk3FYgBPtBhonUAEnCVT8GbRwAUcGiKqyQV5rUNMBULLZTqwC61fztrIeY48B UUCZp9QrORo1BwQIyH3o0ZuEbdWOP15/vz77OMIHyJl/ub0x926Hvcs77zem8XTM0tXx nQ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=C76xuKc0/I/xOs/y/pdbSsixKGVcKLl7S3Wq7XHoPp8=; b=g+ZtKD88ubSQC+FYFkQzPndKIMuKRFEwo3A8vDOIR5jpANFA9/iS6RYEYwYRmU/QtY NLOregB5jyWWtrFM4uLwfnUqgY/MX33V8SVRTHt1WD7rLrNsoyDRcXJ8pSyR8K5CF0Ih eDyrMIOt5DkjFgrLNxtKDm4B2aT+2D9HVLJYuhqg1CQ5TQOvpBy89892gHI6vPS+Jxn9 md+iJR66JSKXHwMAXfNHiyPf3hbbOoNHnaftS32l3Hb7C7qQK5qJmogtF1AWtd6Qw9qh zFV/xRviMxmEH9MOkFpnnOOX09rTGYtG4M58yxrJCmEpilYH/yW7MTCTnP7o4vrQMaWN Zdig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qONu4UaO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si15206184ioq.84.2021.06.23.04.55.44; Wed, 23 Jun 2021 04:55:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qONu4UaO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230239AbhFWL4O (ORCPT + 99 others); Wed, 23 Jun 2021 07:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230182AbhFWL4N (ORCPT ); Wed, 23 Jun 2021 07:56:13 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6118C061574; Wed, 23 Jun 2021 04:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=C76xuKc0/I/xOs/y/pdbSsixKGVcKLl7S3Wq7XHoPp8=; b=qONu4UaOXnSjh+9vZhiINjShGz FvBdZHJ0lvQRldfL6CjUhxmofCzkMQQr2iCvn1SpLxI1HJauuEhANX1ALoaWfuxypO4JDw9PpR+7E kSkCWU5/73MRD3NyaQwLqN7aRWY4DvMFd6c6TuAt1qRlInpDO9MUQn/qM86sK97NApbKEKpsKKaNY mJL9jYmk8kJxTOL9BxIQXrZRF5WaQf6EgDOOU9tzv92t5OTKAwLTpVSVDNhhxZBtYnCuypmdcxt1N G1oyvvNmsRvX406yjTgW3Y1pFc2kmJbgNFhPexxbRihTD5c8ouUUoh/yh1/W7Eslxs4ncVnpXtx9f tZThuytg==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lw1RA-00FNss-2e; Wed, 23 Jun 2021 11:53:01 +0000 Date: Wed, 23 Jun 2021 12:52:56 +0100 From: Christoph Hellwig To: Matteo Croce Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jens Axboe , linux-kernel@vger.kernel.org, Lennart Poettering , Luca Boccassi , Alexander Viro , Damien Le Moal , Tejun Heo , Javier Gonz??lez , Niklas Cassel , Johannes Thumshirn , Hannes Reinecke , Matthew Wilcox , Christoph Hellwig , JeffleXu Subject: Re: [PATCH v3 3/6] block: refactor sysfs code Message-ID: References: <20210623105858.6978-1-mcroce@linux.microsoft.com> <20210623105858.6978-4-mcroce@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210623105858.6978-4-mcroce@linux.microsoft.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -static void disk_add_events(struct gendisk *disk) > +static void disk_add_sysfs(struct gendisk *disk) > { > /* FIXME: error handling */ > - if (sysfs_create_files(&disk_to_dev(disk)->kobj, disk_events_attrs) < 0) > + if (sysfs_create_files(&disk_to_dev(disk)->kobj, disk_sysfs_attrs) < 0) > pr_warn("%s: failed to create sysfs files for events\n", > disk->disk_name); > +} Actually, what we need here is a way how we can setup the ->groups field of the device to include all attribute groups instead of having to call sysfs_create_files at all.