[03/15] btrfs: sysfs, rename btrfs_device member device_dir_kobj
diff mbox series

Message ID 20191118084656.3089-4-anand.jain@oracle.com
State New
Headers show
Series
  • btrfs: sysfs, cleanups
Related show

Commit Message

Anand Jain Nov. 18, 2019, 8:46 a.m. UTC
The struct member btrfs_device::device_dir_kobj holds the kobj of the
sysfs directory /sys/fs/btrfs/UUID/devices, so rename its holder from
device_dir_kobj to devices_dir_kobj. No functional changes.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/sysfs.c   | 28 ++++++++++++++--------------
 fs/btrfs/volumes.h |  2 +-
 2 files changed, 15 insertions(+), 15 deletions(-)

Patch
diff mbox series

diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 399b9c46790c..1d58187a6b33 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -744,10 +744,10 @@  static int addrm_unknown_feature_attrs(struct btrfs_fs_info *fs_info, bool add)
 
 static void __btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs)
 {
-	if (fs_devs->device_dir_kobj) {
-		kobject_del(fs_devs->device_dir_kobj);
-		kobject_put(fs_devs->device_dir_kobj);
-		fs_devs->device_dir_kobj = NULL;
+	if (fs_devs->devices_dir_kobj) {
+		kobject_del(fs_devs->devices_dir_kobj);
+		kobject_put(fs_devs->devices_dir_kobj);
+		fs_devs->devices_dir_kobj = NULL;
 	}
 
 	if (fs_devs->fsid_kobj.state_initialized) {
@@ -979,15 +979,15 @@  int btrfs_sysfs_remove_device_info(struct btrfs_fs_devices *fs_devices,
 	struct hd_struct *disk;
 	struct kobject *disk_kobj;
 
-	if (!fs_devices->device_dir_kobj)
+	if (!fs_devices->devices_dir_kobj)
 		return -EINVAL;
 
 	if (one_device && one_device->bdev) {
 		disk = one_device->bdev->bd_part;
 		disk_kobj = &part_to_dev(disk)->kobj;
 
-		sysfs_remove_link(fs_devices->device_dir_kobj,
-						disk_kobj->name);
+		sysfs_remove_link(fs_devices->devices_dir_kobj,
+				  disk_kobj->name);
 	}
 
 	if (one_device)
@@ -1000,8 +1000,8 @@  int btrfs_sysfs_remove_device_info(struct btrfs_fs_devices *fs_devices,
 		disk = one_device->bdev->bd_part;
 		disk_kobj = &part_to_dev(disk)->kobj;
 
-		sysfs_remove_link(fs_devices->device_dir_kobj,
-						disk_kobj->name);
+		sysfs_remove_link(fs_devices->devices_dir_kobj,
+				  disk_kobj->name);
 	}
 
 	return 0;
@@ -1009,11 +1009,11 @@  int btrfs_sysfs_remove_device_info(struct btrfs_fs_devices *fs_devices,
 
 int btrfs_sysfs_add_devices_dir(struct btrfs_fs_devices *fs_devs)
 {
-	if (!fs_devs->device_dir_kobj)
-		fs_devs->device_dir_kobj = kobject_create_and_add("devices",
-						&fs_devs->fsid_kobj);
+	if (!fs_devs->devices_dir_kobj)
+		fs_devs->devices_dir_kobj = kobject_create_and_add("devices",
+							&fs_devs->fsid_kobj);
 
-	if (!fs_devs->device_dir_kobj)
+	if (!fs_devs->devices_dir_kobj)
 		return -ENOMEM;
 
 	return 0;
@@ -1038,7 +1038,7 @@  int btrfs_sysfs_add_device_info(struct btrfs_fs_devices *fs_devices,
 		disk = dev->bdev->bd_part;
 		disk_kobj = &part_to_dev(disk)->kobj;
 
-		error = sysfs_create_link(fs_devices->device_dir_kobj,
+		error = sysfs_create_link(fs_devices->devices_dir_kobj,
 					  disk_kobj, disk_kobj->name);
 		if (error)
 			break;
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index fc1b564b9cfe..012e75f29fe0 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -255,7 +255,7 @@  struct btrfs_fs_devices {
 	struct btrfs_fs_info *fs_info;
 	/* sysfs kobjects */
 	struct kobject fsid_kobj;
-	struct kobject *device_dir_kobj;
+	struct kobject *devices_dir_kobj;
 	struct completion kobj_unregister;
 };