All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 01/15] btrfs: sysfs, rename device_link add,remove functions
Date: Mon, 18 Nov 2019 16:46:42 +0800	[thread overview]
Message-ID: <20191118084656.3089-2-anand.jain@oracle.com> (raw)
In-Reply-To: <20191118084656.3089-1-anand.jain@oracle.com>

In preparation to add btrfs_device::dev_state attribute in
  /sys/fs/btrfs/UUID/devices/

Rename btrfs_sysfs_add_device_link() and btrfs_sysfs_rm_device_link() to
btrfs_sysfs_add_device_info() and btrfs_sysfs_remove_device_info() as
these functions is going to create more attributes rather than just the
link to the disk. No functional changes.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/dev-replace.c |  4 ++--
 fs/btrfs/sysfs.c       | 10 +++++-----
 fs/btrfs/sysfs.h       |  4 ++--
 fs/btrfs/volumes.c     |  8 ++++----
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
index f639dde2a679..8184ddad28cf 100644
--- a/fs/btrfs/dev-replace.c
+++ b/fs/btrfs/dev-replace.c
@@ -472,7 +472,7 @@ static int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info,
 	atomic64_set(&dev_replace->num_uncorrectable_read_errors, 0);
 	up_write(&dev_replace->rwsem);
 
-	ret = btrfs_sysfs_add_device_link(tgt_device->fs_devices, tgt_device);
+	ret = btrfs_sysfs_add_device_info(tgt_device->fs_devices, tgt_device);
 	if (ret)
 		btrfs_err(fs_info, "kobj add dev failed %d", ret);
 
@@ -706,7 +706,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
 	mutex_unlock(&fs_info->fs_devices->device_list_mutex);
 
 	/* replace the sysfs entry */
-	btrfs_sysfs_rm_device_link(fs_info->fs_devices, src_device);
+	btrfs_sysfs_remove_device_info(fs_info->fs_devices, src_device);
 	btrfs_rm_dev_replace_free_srcdev(src_device);
 
 	/* write back the superblocks */
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 343d535a8081..76ee266f0b8d 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -784,7 +784,7 @@ void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info)
 	addrm_unknown_feature_attrs(fs_info, false);
 	sysfs_remove_group(&fs_info->fs_devices->fsid_kobj, &btrfs_feature_attr_group);
 	sysfs_remove_files(&fs_info->fs_devices->fsid_kobj, btrfs_attrs);
-	btrfs_sysfs_rm_device_link(fs_info->fs_devices, NULL);
+	btrfs_sysfs_remove_device_info(fs_info->fs_devices, NULL);
 }
 
 static const char * const btrfs_feature_set_names[FEAT_MAX] = {
@@ -973,7 +973,7 @@ int btrfs_sysfs_add_space_info_type(struct btrfs_fs_info *fs_info,
 
 /* when one_device is NULL, it removes all device links */
 
-int btrfs_sysfs_rm_device_link(struct btrfs_fs_devices *fs_devices,
+int btrfs_sysfs_remove_device_info(struct btrfs_fs_devices *fs_devices,
 		struct btrfs_device *one_device)
 {
 	struct hd_struct *disk;
@@ -1019,7 +1019,7 @@ int btrfs_sysfs_add_device(struct btrfs_fs_devices *fs_devs)
 	return 0;
 }
 
-int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices,
+int btrfs_sysfs_add_device_info(struct btrfs_fs_devices *fs_devices,
 				struct btrfs_device *one_device)
 {
 	int error = 0;
@@ -1105,13 +1105,13 @@ int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info)
 
 	btrfs_set_fs_info_ptr(fs_info);
 
-	error = btrfs_sysfs_add_device_link(fs_devs, NULL);
+	error = btrfs_sysfs_add_device_info(fs_devs, NULL);
 	if (error)
 		return error;
 
 	error = sysfs_create_files(fsid_kobj, btrfs_attrs);
 	if (error) {
-		btrfs_sysfs_rm_device_link(fs_devs, NULL);
+		btrfs_sysfs_remove_device_info(fs_devs, NULL);
 		return error;
 	}
 
diff --git a/fs/btrfs/sysfs.h b/fs/btrfs/sysfs.h
index e10c3adfc30f..4b624e7d97c1 100644
--- a/fs/btrfs/sysfs.h
+++ b/fs/btrfs/sysfs.h
@@ -14,9 +14,9 @@ enum btrfs_feature_set {
 
 char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags);
 const char * const btrfs_feature_set_name(enum btrfs_feature_set set);
-int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices,
+int btrfs_sysfs_add_device_info(struct btrfs_fs_devices *fs_devices,
 		struct btrfs_device *one_device);
-int btrfs_sysfs_rm_device_link(struct btrfs_fs_devices *fs_devices,
+int btrfs_sysfs_remove_device_info(struct btrfs_fs_devices *fs_devices,
                 struct btrfs_device *one_device);
 int btrfs_sysfs_add_fsid(struct btrfs_fs_devices *fs_devs,
 				struct kobject *parent);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index d8e5560db285..40d77b5846dc 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2012,7 +2012,7 @@ int btrfs_rm_device(struct btrfs_fs_info *fs_info, const char *device_path,
 	if (device->bdev) {
 		cur_devices->open_devices--;
 		/* remove sysfs entry */
-		btrfs_sysfs_rm_device_link(fs_devices, device);
+		btrfs_sysfs_remove_device_info(fs_devices, device);
 	}
 
 	num_devices = btrfs_super_num_devices(fs_info->super_copy) - 1;
@@ -2133,7 +2133,7 @@ void btrfs_destroy_dev_replace_tgtdev(struct btrfs_device *tgtdev)
 	WARN_ON(!tgtdev);
 	mutex_lock(&fs_devices->device_list_mutex);
 
-	btrfs_sysfs_rm_device_link(fs_devices, tgtdev);
+	btrfs_sysfs_remove_device_info(fs_devices, tgtdev);
 
 	if (tgtdev->bdev)
 		fs_devices->open_devices--;
@@ -2481,7 +2481,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
 				    orig_super_num_devices + 1);
 
 	/* add sysfs device entry */
-	btrfs_sysfs_add_device_link(fs_devices, device);
+	btrfs_sysfs_add_device_info(fs_devices, device);
 
 	/*
 	 * we've got more storage, clear any full flags on the space
@@ -2549,7 +2549,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
 	return ret;
 
 error_sysfs:
-	btrfs_sysfs_rm_device_link(fs_devices, device);
+	btrfs_sysfs_remove_device_info(fs_devices, device);
 	mutex_lock(&fs_info->fs_devices->device_list_mutex);
 	mutex_lock(&fs_info->chunk_mutex);
 	list_del_rcu(&device->dev_list);
-- 
2.23.0


  reply	other threads:[~2019-11-18  8:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18  8:46 [PATCH 00/15] btrfs: sysfs, cleanups Anand Jain
2019-11-18  8:46 ` Anand Jain [this message]
2019-11-18  8:46 ` [PATCH 02/15] btrfs: sysfs, rename btrfs_sysfs_add_device() Anand Jain
2019-11-18  8:46 ` [PATCH 03/15] btrfs: sysfs, rename btrfs_device member device_dir_kobj Anand Jain
2019-11-18  8:46 ` [PATCH 04/15] btrfs: sysfs, move declared struct near its use Anand Jain
2019-11-18 15:40   ` David Sterba
2019-11-18  8:46 ` [PATCH 05/15] btrfs: sysfs, move /sys/fs/btrfs/UUID related functions together Anand Jain
2019-11-19  9:24   ` Nikolay Borisov
2019-11-19 10:58     ` David Sterba
2019-11-20  5:56       ` Anand Jain
2019-11-22 17:48         ` David Sterba
2019-11-25  3:18           ` Anand Jain
2019-11-18  8:46 ` [PATCH 06/15] btrfs: sysfs, move add remove _mounted function together Anand Jain
2019-11-18  8:46 ` [PATCH 07/15] btrfs: sysfs, delete code in a comment Anand Jain
2019-11-18 15:39   ` David Sterba
2019-11-18  8:46 ` [PATCH 08/15] btrfs: sysfs, btrfs_sysfs_add_fsid() drop unused argument parent Anand Jain
2019-11-18  8:46 ` [PATCH 09/15] btrfs: sysfs, merge btrfs_sysfs_add device_dir and fsid Anand Jain
2019-11-18  8:46 ` [PATCH 10/15] btrfs: volume, btrfs_free_stale_devices() cleanup unreachable code Anand Jain
2019-11-18  8:46 ` [PATCH 11/15] btrfs: sysfs, migrate fs_decvices::fsid_kobject to struct btrfs_fs_info Anand Jain
2019-11-18  8:46 ` [PATCH 12/15] btrfs: sysfs, unexport btrfs_sysfs_add_mounted() Anand Jain
2019-11-18  8:46 ` [PATCH 13/15] btrfs: sysfs, cleanup btrfs_sysfs_remove_fsid() Anand Jain
2019-11-18  8:46 ` [PATCH 14/15] btrfs: sysfs, merge btrfs_sysfs_remove_fsid() helper function Anand Jain
2019-11-18  8:46 ` [PATCH 15/15] btrfs: sysfs, unexport btrfs_sysfs_remove_mounted() Anand Jain
2019-11-18 15:45 ` [PATCH 00/15] btrfs: sysfs, cleanups David Sterba
2019-11-19  6:44   ` Anand Jain
2019-11-19 12:37     ` David Sterba
2019-11-20  6:44       ` Anand Jain

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=20191118084656.3089-2-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.