linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: create example debugfs file only in debugging build
@ 2016-09-01 12:44 David Sterba
  2016-09-01 14:33 ` Eric Sandeen
  0 siblings, 1 reply; 2+ messages in thread
From: David Sterba @ 2016-09-01 12:44 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/sysfs.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 804bd1c42e47..31f09564e170 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -836,9 +836,18 @@ static int btrfs_init_debugfs(void)
 	if (!btrfs_debugfs_root_dentry)
 		return -ENOMEM;
 
+	/*
+	 * Example code, how export data through debugfs.
+	 *
+	 * file:        /sys/kernel/debug/btrfs/test
+	 * contents of: btrfs_debugfs_test
+	 */
+#ifdef CONFIG_BTRFS_DEBUG
 	debugfs_create_u64("test", S_IRUGO | S_IWUSR, btrfs_debugfs_root_dentry,
 			&btrfs_debugfs_test);
 #endif
+
+#endif
 	return 0;
 }
 
-- 
2.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs: create example debugfs file only in debugging build
  2016-09-01 12:44 [PATCH] btrfs: create example debugfs file only in debugging build David Sterba
@ 2016-09-01 14:33 ` Eric Sandeen
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Sandeen @ 2016-09-01 14:33 UTC (permalink / raw)
  To: David Sterba, linux-btrfs

On 9/1/16 7:44 AM, David Sterba wrote:
> Signed-off-by: David Sterba <dsterba@suse.com>

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  fs/btrfs/sysfs.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
> index 804bd1c42e47..31f09564e170 100644
> --- a/fs/btrfs/sysfs.c
> +++ b/fs/btrfs/sysfs.c
> @@ -836,9 +836,18 @@ static int btrfs_init_debugfs(void)
>  	if (!btrfs_debugfs_root_dentry)
>  		return -ENOMEM;
>  
> +	/*
> +	 * Example code, how export data through debugfs.
> +	 *
> +	 * file:        /sys/kernel/debug/btrfs/test
> +	 * contents of: btrfs_debugfs_test
> +	 */
> +#ifdef CONFIG_BTRFS_DEBUG
>  	debugfs_create_u64("test", S_IRUGO | S_IWUSR, btrfs_debugfs_root_dentry,
>  			&btrfs_debugfs_test);
>  #endif
> +
> +#endif
>  	return 0;
>  }
>  
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-01 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-01 12:44 [PATCH] btrfs: create example debugfs file only in debugging build David Sterba
2016-09-01 14:33 ` Eric Sandeen

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).