summaryrefslogtreecommitdiff
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2013-11-01 13:06:58 -0400
committerChris Mason <clm@fb.com>2014-01-28 13:19:25 -0800
commit5ac1d209f11271fbfad0fa31ba56ec64c142d9ea (patch)
tree15f67ec6c85caa87b3358df2876f51becdf04b49 /fs/btrfs/disk-io.c
parent079b72bca30dbc74c86c7c7825b8c34eb86ce3ee (diff)
btrfs: publish per-super attributes in sysfs
This patch adds per-super attributes to sysfs. It doesn't publish any attributes yet, but does the proper lifetime handling as well as the basic infrastructure to add new attributes. 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/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 435ef132b800..81f3433fe4fd 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -48,6 +48,7 @@
#include "rcu-string.h"
#include "dev-replace.h"
#include "raid56.h"
+#include "sysfs.h"
#ifdef CONFIG_X86
#include <asm/cpufeature.h>
@@ -2743,6 +2744,12 @@ retry_root_backup:
btrfs_close_extra_devices(fs_info, fs_devices, 1);
+ ret = btrfs_sysfs_add_one(fs_info);
+ if (ret) {
+ pr_err("btrfs: failed to init sysfs interface: %d\n", ret);
+ goto fail_block_groups;
+ }
+
ret = btrfs_init_space_info(fs_info);
if (ret) {
printk(KERN_ERR "Failed to initial space info: %d\n", ret);
@@ -3584,6 +3591,8 @@ int close_ctree(struct btrfs_root *root)
percpu_counter_sum(&fs_info->delalloc_bytes));
}
+ btrfs_sysfs_remove_one(fs_info);
+
del_fs_roots(fs_info);
btrfs_free_block_groups(fs_info);