Btrfs: sysfs: add pointer to access fs_info from fs_devices
[deliverable/linux.git] / fs / btrfs / volumes.c
index e500bfa54dc9bfa7cbaae08ef9f052f0e7cff1c8..5719470b50cda355a4f41ce590dabadcc3fce9c6 100644 (file)
@@ -6733,3 +6733,21 @@ void btrfs_update_commit_device_bytes_used(struct btrfs_root *root,
        }
        unlock_chunks(root);
 }
+
+void btrfs_set_fs_info_ptr(struct btrfs_fs_info *fs_info)
+{
+       struct btrfs_fs_devices *fs_devices = fs_info->fs_devices;
+       while (fs_devices) {
+               fs_devices->fs_info = fs_info;
+               fs_devices = fs_devices->seed;
+       }
+}
+
+void btrfs_reset_fs_info_ptr(struct btrfs_fs_info *fs_info)
+{
+       struct btrfs_fs_devices *fs_devices = fs_info->fs_devices;
+       while (fs_devices) {
+               fs_devices->fs_info = NULL;
+               fs_devices = fs_devices->seed;
+       }
+}
This page took 0.035762 seconds and 5 git commands to generate.