From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v2 1/5] btrfs: sysfs, rename devices kobject holder to devices_kobj
Date: Thu, 21 Nov 2019 17:33:30 +0800 [thread overview]
Message-ID: <1574328814-12263-2-git-send-email-anand.jain@oracle.com> (raw)
In-Reply-To: <1574328814-12263-1-git-send-email-anand.jain@oracle.com>
The struct member btrfs_device::device_dir_kobj holds the kobj of the
sysfs directory /sys/fs/btrfs/UUID/devices, so rename it from
device_dir_kobj to devices_kobj. No functional changes.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
v2: Rename devices_dir_kobj to devices_kobj
fs/btrfs/sysfs.c | 28 ++++++++++++++--------------
fs/btrfs/volumes.h | 2 +-
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 5ebbe8a5ee76..29e82832ff18 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -734,10 +734,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_kobj) {
+ kobject_del(fs_devs->devices_kobj);
+ kobject_put(fs_devs->devices_kobj);
+ fs_devs->devices_kobj = NULL;
}
if (fs_devs->fsid_kobj.state_initialized) {
@@ -969,15 +969,15 @@ int btrfs_sysfs_rm_device_link(struct btrfs_fs_devices *fs_devices,
struct hd_struct *disk;
struct kobject *disk_kobj;
- if (!fs_devices->device_dir_kobj)
+ if (!fs_devices->devices_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_kobj,
+ disk_kobj->name);
}
if (one_device)
@@ -990,8 +990,8 @@ int btrfs_sysfs_rm_device_link(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_kobj,
+ disk_kobj->name);
}
return 0;
@@ -999,11 +999,11 @@ int btrfs_sysfs_rm_device_link(struct btrfs_fs_devices *fs_devices,
int btrfs_sysfs_add_device(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_kobj)
+ fs_devs->devices_kobj = kobject_create_and_add("devices",
+ &fs_devs->fsid_kobj);
- if (!fs_devs->device_dir_kobj)
+ if (!fs_devs->devices_kobj)
return -ENOMEM;
return 0;
@@ -1028,7 +1028,7 @@ int btrfs_sysfs_add_device_link(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_kobj,
disk_kobj, disk_kobj->name);
if (error)
break;
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index fc1b564b9cfe..3c56ef571b00 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_kobj;
struct completion kobj_unregister;
};
--
1.8.3.1
next prev parent reply other threads:[~2019-11-21 9:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-21 9:33 [PATCH v2 0/5] btrfs: sysfs, cleanups Anand Jain
2019-11-21 9:33 ` Anand Jain [this message]
2019-11-26 16:41 ` [PATCH v2 1/5] btrfs: sysfs, rename devices kobject holder to devices_kobj David Sterba
2019-11-21 9:33 ` [PATCH v2 2/5] btrfs: sysfs, rename device_link add,remove functions Anand Jain
2019-11-26 16:40 ` David Sterba
2019-12-03 5:42 ` Anand Jain
2019-11-21 9:33 ` [PATCH v2 3/5] btrfs: sysfs, btrfs_sysfs_add_fsid() drop unused argument parent Anand Jain
2019-11-21 9:33 ` [PATCH v2 4/5] btrfs: sysfs, rename btrfs_sysfs_add_device() Anand Jain
2019-11-21 9:33 ` [PATCH v2 5/5] btrfs: sysfs, merge btrfs_sysfs_add devices_kobj and fsid Anand Jain
2019-11-26 16:44 ` David Sterba
2019-11-26 16:54 ` [PATCH v2 0/5] btrfs: sysfs, cleanups David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1574328814-12263-2-git-send-email-anand.jain@oracle.com \
--to=anand.jain@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).