From: David Sterba Date: Thu, 1 Sep 2016 12:37:53 +0000 (+0200) Subject: btrfs: create example debugfs file only in debugging build X-Git-Tag: v4.9-rc1~7^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b0de6c4c81099494d7863a31db06366f74395cda;p=platform%2Fkernel%2Flinux-exynos.git btrfs: create example debugfs file only in debugging build Reviewed-by: Eric Sandeen Signed-off-by: David Sterba --- 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; }