From: Anand Jain <anand.j...@oracle.com>

adds fs_info pointer with struct btrfs_fs_devices.

Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
 fs/btrfs/sysfs.c   | 4 ++++
 fs/btrfs/volumes.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index ac15fbb..4b5bac6 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -530,6 +530,8 @@ static void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices 
*fs_devs)
 
 void btrfs_sysfs_remove_one(struct btrfs_fs_info *fs_info)
 {
+       fs_info->fs_devices->fs_info = NULL;
+
        if (fs_info->space_info_kobj) {
                sysfs_remove_files(fs_info->space_info_kobj, allocation_attrs);
                kobject_del(fs_info->space_info_kobj);
@@ -729,6 +731,8 @@ int btrfs_sysfs_add_one(struct btrfs_fs_info *fs_info)
        struct btrfs_fs_devices *fs_devs = fs_info->fs_devices;
        struct kobject *super_kobj = &fs_devs->super_kobj;
 
+       fs_devs->fs_info = fs_info;
+
        error = btrfs_sysfs_add_fsid(fs_devs, NULL);
        if (error)
                return error;
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index c2e5bd0..53fd278 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -254,6 +254,7 @@ struct btrfs_fs_devices {
         */
        int rotating;
 
+       struct btrfs_fs_info *fs_info;
        /* sysfs kobjects */
        struct kobject super_kobj;
        struct kobject *device_dir_kobj;
-- 
2.0.0.153.g79dcccc

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to