summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-09-01 14:37:53 +0200
committerDavid Sterba <dsterba@suse.com>2016-09-26 17:59:49 +0200
commitb0de6c4c81099494d7863a31db06366f74395cda (patch)
treef792d52b7a9b09dd00eedaed99dafa8757e197a8
parent07f6a480436595394a06a69d0ebc18fef6736197 (diff)
downloadop-kernel-dev-b0de6c4c81099494d7863a31db06366f74395cda.zip
op-kernel-dev-b0de6c4c81099494d7863a31db06366f74395cda.tar.gz
btrfs: create example debugfs file only in debugging build
Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/sysfs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 804bd1c..e498a47 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 to 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;
}
OpenPOWER on IntegriCloud