Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp317279pxj; Wed, 23 Jun 2021 23:16:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPUsXgfsBnpdMm5Fqlh0m+ZbSwhGwc89ufNROQ2zl7tTgyWCYcSpgAj30+8LG4L9zygM+R X-Received: by 2002:a05:6402:397:: with SMTP id o23mr1990800edv.217.1624515398428; Wed, 23 Jun 2021 23:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624515398; cv=none; d=google.com; s=arc-20160816; b=DnzCTs8zsGPaTnm2dMWi/J8EX7d/IbFoGvY+/O4fkE7pGRFJ1TOIpGsL4lXQUgvcsh bcpMKni0Qi9wZcXLyVEciC3sehPgqAo+Gi4iPchzGYft6Zp60zyaU+yy6BBeQyqxf3WQ moo33RfWBgNybj9kHhvSkQiVQooeQUnTdtV/1P1d/KoxGE8Skek2DoLOpsDzwjiivyFd 3YNbUxBj1Xf5pwtTqLlVffwISJPMtUi7S4chzs8cp+tyoJYF0W4uMJ2U+DyQ26H13x+r UebBleuEnrr/WBbAyzQrw4+p6yygCbnW+c46wOASAfm+3qBTjjwT2ecZ+NIbuAO22/y2 7kYA== 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=sSFHXo3Gj4dSjFJuKq0lyHYwfOL1EKEDwVgBxUfbffw=; b=TjYUdhklGpb/d+ATnIe8erRDEew6zW/3FH9EXAhbrp3t7YkzTlIY6C2znCoujzLAU5 wryFmUvsowTBYg1QQ356scfEERxWmvDn2Rjt0Tlz+OGw8vW3ZKp7Qmj7yOcYFwl0NXWW 1Y1pKGG9TVpFKxn2xiSGvNIJmvun4JiogWYuk6rKH4FWIcDs1sSa4udOnizlOBjL3FhX ykSaXfGfDioeKWq4kXgl1+e86QIY3h8YNWSEJH9FIeE1Oi94fQ2kGz/vsW0lhzZa8nhN 4TeaXm4yBgeLsj07W+sZxvfisiOX51a9+CfWCYv4AiVyYNZanbWtGfeunABqGGhPN0zQ Lg/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="t4/xd1iR"; 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 l3si2378219ejd.313.2021.06.23.23.16.07; Wed, 23 Jun 2021 23:16:38 -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="t4/xd1iR"; 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 S231228AbhFXGQa (ORCPT + 99 others); Thu, 24 Jun 2021 02:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230518AbhFXGQa (ORCPT ); Thu, 24 Jun 2021 02:16:30 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C26ACC061574; Wed, 23 Jun 2021 23:14:11 -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=sSFHXo3Gj4dSjFJuKq0lyHYwfOL1EKEDwVgBxUfbffw=; b=t4/xd1iRSTshzW9JK+ypF4gUvU DiOLXv1n179uEuNdX25CkPiklMEzjEZvgwAVqPPFECZ7cw7Xirlw9BxwbTT3+G+VFQRWgj//+tcl5 fBZcyFlGX0MOBtXe+2zlZBhDGeCUvKMfW7LUvpq4wYEiz3WHQH0mEuROU84c9reuI9kUN/+UAq7FI IJts0WQWke3KSLvKBUeP9HswUP6IfxrKG9EtQLd70TEJluWLme7q5vD6VkXaNsA486/ZCtQXlcPhc 4ACaHId9qdfCOYhJCpJmucL4SGSEs2rvkE4WSwaTNDiwkyDIXQEbv3olSWfx2lh5rhY42ZRizrzIz OtKHbZ2Q==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwIbX-00GFEb-EP; Thu, 24 Jun 2021 06:12:55 +0000 Date: Thu, 24 Jun 2021 07:12:47 +0100 From: Christoph Hellwig To: Matteo Croce Cc: Christoph Hellwig , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jens Axboe , Linux Kernel Mailing List , Lennart Poettering , Luca Boccassi , Alexander Viro , Damien Le Moal , Tejun Heo , Javier Gonz??lez , Niklas Cassel , Johannes Thumshirn , Hannes Reinecke , Matthew Wilcox , 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: 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 On Wed, Jun 23, 2021 at 09:03:40PM +0200, Matteo Croce wrote: > On Wed, Jun 23, 2021 at 1:53 PM Christoph Hellwig wrote: > > > > > -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. > > I don't get this one. You mean in general or in this series? In general before we make more use of the block device provided attrs.