This patch set will provide a framework and help to create attributes from the structure btrfs_fs_devices which are available even before fs_info is created. So by moving the parent kobject super_kobj from fs_info to btrfs_fs_devices, it will help to create attributes from the btrfs_fs_devices as well. Just to note, this does not change any of the existing btrfs sysfs external kobject names and its attributes and not even the life cycle of them. Changes are internal only. And to ensure the same, this path has been tested with various device operations and, checking and comparing the sysfs kobjects and attributes with sysfs kobject and attributes with out this patch, and they remain same. These test cases are added to the progs as test-btrfs-devmgt.sh, its patch is below as well.
Anand Jain (12): Btrfs: sysfs: fix, btrfs_release_super_kobj() should to clean up the kobject data Btrfs: sysfs: fix, fs_info kobject_unregister has init_completion() twice Btrfs: sysfs: fix, undo sysfs device links Btrfs: sysfs: fix, kobject pointer clean up needed after kobject release Btrfc: sysfs: fix, check if device_dir_kobj is init before destroy Btrfs: sysfs: reorder the kobject creations Btrfs: sysfs: rename __btrfs_sysfs_remove_one to btrfs_sysfs_remove_fsid Btrfs: sysfs: introduce function btrfs_sysfs_add_fsid() to create sysfs fsid Btrfs: sysfs: let default_attrs be separate from the kset Btrfs: sysfs: separate device kobject and its attribute creation Btrfs: sysfs: move super_kobj and device_dir_kobj from fs_info to btrfs_fs_devices Btrfs: sysfs: add pointer to access fs_info from fs_devices fs/btrfs/ctree.h | 3 -- fs/btrfs/disk-io.c | 1 - fs/btrfs/sysfs.c | 133 +++++++++++++++++++++++++++++++++++++++-------------- fs/btrfs/volumes.c | 3 +- fs/btrfs/volumes.h | 6 +++ 5 files changed, 107 insertions(+), 39 deletions(-) Anand Jain (1): Btrfs-progs: add regression tests for sysfs contents during btrfs device management tests/test-btrfs-devmgt.sh | 863 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 863 insertions(+) create mode 100755 tests/test-btrfs-devmgt.sh -- 1.9.1 -- 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