Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7483143yba; Thu, 2 May 2019 10:36:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSQ0MXw7yRCkz7hymDiqfKOFYDz78dWkHDdMcezqKRf96r68zI+aurDjbFYxvaEXNB0K+l X-Received: by 2002:aa7:93a7:: with SMTP id x7mr5548995pff.196.1556818590527; Thu, 02 May 2019 10:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556818590; cv=none; d=google.com; s=arc-20160816; b=FUzVWx8Ip8kl7ubzdB0CAtwYl7zWV9AOUF5eUqYDAdkAnhWkqCHVG92YNhE5W0rUfz fQX11RtMWRsXVsaSwVU88c/jdPEQZUaEqYD7YMyqWjynDpNFolVKzvksnbTH0mPkKQpZ 5/wNoZjEOfRddXHIFw84ZkwlbZrhqrjKb362iErfs8CfotZhJo07RrTTv+jLbhznNZnE Ta9sE2yIpN2kg2UUFNYzcAvzeeX0EDdCdhScdj5piSyltCEP0ianua+WwUjEO3g4vZfN PWthYzo7L6R9UCtPp9d55sqaoYtKUd/Z6fjVtSeWPbxyewWO+FXDccEkhT+jEbOsUM53 fRJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :dkim-signature; bh=2CcPxb2C1RD8skQYG5/aPu30Ko1ajsjTfrv46WpisqI=; b=HqiQe1A+/v8NpBSiEw506nUbo2JZp+R453+WD14/jM47txK80Jw45p45yhJjPQvvTp xq2uXyKxKzvTew8x8ERgVcsKtixKKGw656SxnKOgNHw8PML9kjPDTmOXDRY+A3HkJzRn 1l404RFHTNa+v3AXlA+lCd9CKKZR3Bj4RcSQTw3kOcFM66nYpFAFGL640PSXLzy3ih0v pUYw293ONNCxP+PhbbereQHX+WQmpQOUql0V4d/ykeeyfv8m9RL5K/p891a7cbDpPlxQ KgVPTVPVpQH6V6K9QMuX6OQmSskPOR5rN3SBpYGUNFpVK5+Mqio9GsrlE2EI0aeeU/Wn R9hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pUcPnxxM; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10si26271749pgq.334.2019.05.02.10.36.15; Thu, 02 May 2019 10:36:30 -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=pass header.i=@gmail.com header.s=20161025 header.b=pUcPnxxM; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726568AbfEBRev (ORCPT + 99 others); Thu, 2 May 2019 13:34:51 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:45634 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726435AbfEBRet (ORCPT ); Thu, 2 May 2019 13:34:49 -0400 Received: by mail-io1-f68.google.com with SMTP id e8so2876926ioe.12; Thu, 02 May 2019 10:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=2CcPxb2C1RD8skQYG5/aPu30Ko1ajsjTfrv46WpisqI=; b=pUcPnxxMpboqsl0DnnCKyfxXhc+Ju34Ex6IxNulCB2V8gIBk4Z6WikMHKUI6RbMw2/ +B1uaIq/My7DQE9yln36akCU7M78apGBz5vyUXyLvitYcy52iZtpXXhA4lXBDItXclm/ h4px6LFiGmvEeYlISVpctg8/UXzDdp0N5UAEU9asQxb2KnrUPnhjFMmg83kf2Of3/V2/ pqlsnFiRagqIMBAT5/7i/THqxLpp9c3/eM8u2B0MfmOnxr4J13gwaDvDWoqNF8p7OCGs AC3suog2DW8SGAskQEdtIkA6bRYutD706Ml8wl7H8REhbbHXQb/QFV1kf4UmlmH+fX81 4p/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=2CcPxb2C1RD8skQYG5/aPu30Ko1ajsjTfrv46WpisqI=; b=ShsHcxtjcdio1q45Fvonv3vzCMYgZVN7UUK+uogAbzoJhkBsZ+pnXucSFKOFaGi6ub lTQeO+EGwsm4Bd08LHb+yzOw49fe16LNY7aaTskPjIPm3WKYZ8x5wp+48E1VJr7lxtsa sULzDbvbpwDAQXwZGP2PDpcifrdC+SZj6WqUVeU3RWvJvIuyHBWl0SbzOYEQLqG8YlE/ 9LdQo6Dbzt2NGrW5n8Jx3UyCOq6gB4gRckv+8ske1QYu+859EZuwjO3U7+cwg6wPWX86 0bffjwvCnphpLjtIZa1wQoLpC/AIQpk1lR6LBHx3KuhWl3ALBe81v9AaSyoER9ByShyq 7+Iw== X-Gm-Message-State: APjAAAVtxsQBMdep8lByzayPQEBQwanoTMAVhqNOKAetToh+Czb9Qeqo Hn5MjYswECXLuA93lVWyWvfqz4GiRUQ= X-Received: by 2002:a05:6602:55:: with SMTP id z21mr3458329ioz.101.1556818488067; Thu, 02 May 2019 10:34:48 -0700 (PDT) Received: from ubu (2600-6c48-437f-c81d-b1d9-7ff0-b1de-5362.dhcp6.chtrptr.net. [2600:6c48:437f:c81d:b1d9:7ff0:b1de:5362]) by smtp.gmail.com with ESMTPSA id l1sm16146729iop.67.2019.05.02.10.34.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 May 2019 10:34:46 -0700 (PDT) From: Kimberly Brown To: Chris Mason , Josef Bacik , David Sterba , Greg Kroah-Hartman , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] btrfs: sysfs: Replace default_attrs in ktypes with groups Date: Thu, 2 May 2019 13:34:45 -0400 Message-Id: <20190502173445.5308-1-kimbrownkd@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The kobj_type default_attrs field is being replaced by the default_groups field. Replace the default_attrs fields in btrfs_raid_ktype and space_info_ktype with default_groups. Change "raid_attributes" to "raid_attrs", and use the ATTRIBUTE_GROUPS macro to create raid_groups and space_info_groups. Signed-off-by: Kimberly Brown --- This patch depends on a patch in the driver-core tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=driver-core-next&id=aa30f47cf666111f6bbfd15f290a27e8a7b9d854 GregKH can take this patch through the driver-core tree, or this patch can wait a release cycle and go through the subsystem's tree, whichever the subsystem maintainer is more comfortable with. fs/btrfs/sysfs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 5a5930e3d32b..ae0ad84a11aa 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -303,11 +303,12 @@ static ssize_t raid_bytes_show(struct kobject *kobj, return snprintf(buf, PAGE_SIZE, "%llu\n", val); } -static struct attribute *raid_attributes[] = { +static struct attribute *raid_attrs[] = { BTRFS_ATTR_PTR(raid, total_bytes), BTRFS_ATTR_PTR(raid, used_bytes), NULL }; +ATTRIBUTE_GROUPS(raid); static void release_raid_kobj(struct kobject *kobj) { @@ -317,7 +318,7 @@ static void release_raid_kobj(struct kobject *kobj) struct kobj_type btrfs_raid_ktype = { .sysfs_ops = &kobj_sysfs_ops, .release = release_raid_kobj, - .default_attrs = raid_attributes, + .default_groups = raid_groups, }; #define SPACE_INFO_ATTR(field) \ @@ -364,6 +365,7 @@ static struct attribute *space_info_attrs[] = { BTRFS_ATTR_PTR(space_info, total_bytes_pinned), NULL, }; +ATTRIBUTE_GROUPS(space_info); static void space_info_release(struct kobject *kobj) { @@ -375,7 +377,7 @@ static void space_info_release(struct kobject *kobj) struct kobj_type space_info_ktype = { .sysfs_ops = &kobj_sysfs_ops, .release = space_info_release, - .default_attrs = space_info_attrs, + .default_groups = space_info_groups, }; static const struct attribute *allocation_attrs[] = { -- 2.17.1