linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Anand Jain <anand.jain@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: sysfs: map sysfs files to their path
Date: Mon, 9 Aug 2021 16:36:46 +0200	[thread overview]
Message-ID: <20210809143646.GO5047@twin.jikos.cz> (raw)
In-Reply-To: <8a0aac47cbdcc25b7ec861a5d334db1b6add34ae.1628125284.git.anand.jain@oracle.com>

On Thu, Aug 05, 2021 at 09:02:46AM +0800, Anand Jain wrote:
> Sysfs file has grown big. It takes some time to locate the correct
> struct attribute to add new files. Create a table and map the
> struct attribute to its sysfs path.
> 
> Also, fix the comment about the debug sysfs path.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
>  fs/btrfs/sysfs.c | 22 +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
> index bfe5e27617b0..cb00c0c08949 100644
> --- a/fs/btrfs/sysfs.c
> +++ b/fs/btrfs/sysfs.c
> @@ -22,6 +22,26 @@
>  #include "block-group.h"
>  #include "qgroup.h"
>  
> +
> +/*
> + * struct attributes (sysfs files)	sysfs path
> + * --------------------------------------------------------------------------
> + * btrfs_supported_static_feature_attrs /sys/fs/btrfs/features
> + * btrfs_supported_feature_attrs        /sys/fs/btrfs/features and
> + *					/sys/fs/btrfs/uuid/features (if visible)
> + * btrfs_debug_feature_attrs		/sys/fs/btrfs/debug
> + * btrfs_debug_mount_attrs		/sys/fs/btrfs/<uuid>/debug
> + * discard_debug_attrs			/sys/fs/btrfs/<uuid>/debug/discard
> + * btrfs_attrs				/sys/fs/btrfs/<uuid>
> + * devid_attrs				/sys/fs/btrfs/<uuid>/devinfo/<devid>
> + * allocation_attrs			/sys/fs/btrfs/<uuid>/allocation
> + * qgroup_attrs				/sys/fs/btrfs/<uuid>/qgroups/<subvol-id>/
> + * space_info_attrs		/sys/fs/btrfs/<uuid>/allocation/<bg-type>
> + * raid_attrs		/sys/fs/btrfs/<uuid>/allocation/<bg-type>/<bg-profile>
> + */

I think this would be better next to the definitions, so you don't have
to repeat the identifier name and it's at the same location once we need
to add more attributes.

  reply	other threads:[~2021-08-09 14:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05  1:02 [PATCH] btrfs: sysfs: map sysfs files to their path Anand Jain
2021-08-09 14:36 ` David Sterba [this message]
2021-08-10  0:34   ` Anand Jain
2021-08-10  9:48     ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210809143646.GO5047@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).