Skip to content

Commit

Permalink
btrfs: create example debugfs file only in debugging build
Browse files Browse the repository at this point in the history
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
David Sterba committed Sep 26, 2016
1 parent 07f6a48 commit b0de6c4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fs/btrfs/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,17 @@ 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;
}
Expand Down

0 comments on commit b0de6c4

Please sign in to comment.