summaryrefslogtreecommitdiff
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 13:19:29 -0800
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 = \
BTRFS_ATTR_RW(_name, _mode, _show, NULL)
#define BTRFS_ATTR_PTR(_name) (&btrfs_attr_##_name.attr)
+#define BTRFS_RAID_ATTR(_name, _show) \
+static struct kobj_attribute btrfs_raid_attr_##_name = \
+ __INIT_KOBJ_ATTR(_name, 0444, _show, NULL)
+#define BTRFS_RAID_ATTR_PTR(_name) (&btrfs_raid_attr_##_name.attr)
+
+
struct btrfs_feature_attr {
struct kobj_attribute kobj_attr;
enum btrfs_feature_set feature_set;
@@ -53,4 +59,6 @@ static struct btrfs_feature_attr btrfs_attr_##_name = { \
to_btrfs_feature_attr(attr_to_btrfs_attr(a))
char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags);
extern const char * const btrfs_feature_set_names[3];
+extern struct kobj_type space_info_ktype;
+extern struct kobj_type btrfs_raid_ktype;
#endif /* _BTRFS_SYSFS_H_ */