aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/sysfs.c
diff options
context:
space:
mode:
authorAnand Jain <Anand.Jain@oracle.com>2015-03-09 18:38:26 -0400
committerDavid Sterba <dsterba@suse.cz>2015-05-27 06:27:20 -0400
commit720592157eeef627ff9a7c7c55ab1713bc48fb50 (patch)
treeba665360c5a7f7b58b937cc5a15ec34d9c6bf205 /fs/btrfs/sysfs.c
parent3a08f3b72a4f03e413d89d8505b17c05194e63f9 (diff)
Btrfs: sysfs: introduce function btrfs_sysfs_add_fsid() to create sysfs fsid
We need it in a seperate function so that it can be called from the device discovery thread as well. Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/sysfs.c')
-rw-r--r--fs/btrfs/sysfs.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 8b6eff48268a..83c0c5d5368b 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -690,7 +690,12 @@ static struct dentry *btrfs_debugfs_root_dentry;
690/* Debugging tunables and exported data */ 690/* Debugging tunables and exported data */
691u64 btrfs_debugfs_test; 691u64 btrfs_debugfs_test;
692 692
693int btrfs_sysfs_add_one(struct btrfs_fs_info *fs_info) 693/*
694 * Can be called by the device discovery thread.
695 * And parent can be specified for seed device
696 */
697int btrfs_sysfs_add_fsid(struct btrfs_fs_info *fs_info,
698 struct kobject *parent)
694{ 699{
695 int error; 700 int error;
696 701
@@ -698,6 +703,14 @@ int btrfs_sysfs_add_one(struct btrfs_fs_info *fs_info)
698 fs_info->super_kobj.kset = btrfs_kset; 703 fs_info->super_kobj.kset = btrfs_kset;
699 error = kobject_init_and_add(&fs_info->super_kobj, &btrfs_ktype, NULL, 704 error = kobject_init_and_add(&fs_info->super_kobj, &btrfs_ktype, NULL,
700 "%pU", fs_info->fsid); 705 "%pU", fs_info->fsid);
706 return error;
707}
708
709int btrfs_sysfs_add_one(struct btrfs_fs_info *fs_info)
710{
711 int error;
712
713 error = btrfs_sysfs_add_fsid(fs_info, NULL);
701 if (error) 714 if (error)
702 return error; 715 return error;
703 716