aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/sysfs.h
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2013-11-01 13:07:04 -0400
committerChris Mason <clm@fb.com>2014-01-28 16:19:29 -0500
commit6ab0a2029ceaedb78af807871820708b7353e3be (patch)
treeec9684534264d7b6d2cc0e6137ad7c7f851b1e88 /fs/btrfs/sysfs.h
parent01e219e8069516cdb98594d417b8bb8d906ed30d (diff)
btrfs: publish allocation data in sysfs
While trying to debug ENOSPC issues, it's helpful to understand what the kernel's view of the available space is. We export this information via ioctl, but sysfs files are more easily used. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/sysfs.h')
-rw-r--r--fs/btrfs/sysfs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/sysfs.h b/fs/btrfs/sysfs.h
index c49fd25c911f..f3cea3710d44 100644
--- a/fs/btrfs/sysfs.h
+++ b/fs/btrfs/sysfs.h
@@ -22,6 +22,12 @@ static struct kobj_attribute btrfs_attr_##_name = \
22 BTRFS_ATTR_RW(_name, _mode, _show, NULL) 22 BTRFS_ATTR_RW(_name, _mode, _show, NULL)
23#define BTRFS_ATTR_PTR(_name) (&btrfs_attr_##_name.attr) 23#define BTRFS_ATTR_PTR(_name) (&btrfs_attr_##_name.attr)
24 24
25#define BTRFS_RAID_ATTR(_name, _show) \
26static struct kobj_attribute btrfs_raid_attr_##_name = \
27 __INIT_KOBJ_ATTR(_name, 0444, _show, NULL)
28#define BTRFS_RAID_ATTR_PTR(_name) (&btrfs_raid_attr_##_name.attr)
29
30
25struct btrfs_feature_attr { 31struct btrfs_feature_attr {
26 struct kobj_attribute kobj_attr; 32 struct kobj_attribute kobj_attr;
27 enum btrfs_feature_set feature_set; 33 enum btrfs_feature_set feature_set;
@@ -53,4 +59,6 @@ static struct btrfs_feature_attr btrfs_attr_##_name = { \
53 to_btrfs_feature_attr(attr_to_btrfs_attr(a)) 59 to_btrfs_feature_attr(attr_to_btrfs_attr(a))
54char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags); 60char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags);
55extern const char * const btrfs_feature_set_names[3]; 61extern const char * const btrfs_feature_set_names[3];
62extern struct kobj_type space_info_ktype;
63extern struct kobj_type btrfs_raid_ktype;
56#endif /* _BTRFS_SYSFS_H_ */ 64#endif /* _BTRFS_SYSFS_H_ */