From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v2] btrfs: rename btrfs_close_extra_device to btrfs_free_extra_devids
Date: Tue, 27 Feb 2018 12:41:59 +0800 [thread overview]
Message-ID: <20180227044159.27975-1-anand.jain@oracle.com> (raw)
In-Reply-To: <20180227043242.26367-1-anand.jain@oracle.com>
This function btrfs_close_extra_devices() is about freeing
extra devids which once it may have belonged to this fsid.
So rename it and add the comment. The _devid suffix is
appropriate as this function won't handle devices which are
outside of the fsid being mounted.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
v1->v2: fix missing git commit --amend
fs/btrfs/disk-io.c | 6 +++---
fs/btrfs/volumes.c | 6 +++++-
fs/btrfs/volumes.h | 2 +-
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 798e602c1834..c82f8a471c32 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2758,10 +2758,10 @@ int open_ctree(struct super_block *sb,
}
/*
- * keep the device that is marked to be the target device for the
+ * keep the devid that is marked to be the target device for the
* dev_replace procedure
*/
- btrfs_close_extra_devices(fs_devices, 0);
+ btrfs_free_extra_devids(fs_devices, 0);
if (!fs_devices->latest_bdev) {
btrfs_err(fs_info, "failed to read devices");
@@ -2824,7 +2824,7 @@ int open_ctree(struct super_block *sb,
goto fail_block_groups;
}
- btrfs_close_extra_devices(fs_devices, 1);
+ btrfs_free_extra_devids(fs_devices, 1);
ret = btrfs_sysfs_add_fsid(fs_devices, NULL);
if (ret) {
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index f0ebf36f02fd..430e5c2e7e1d 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -896,7 +896,11 @@ static struct btrfs_fs_devices *clone_fs_devices(struct btrfs_fs_devices *orig)
return ERR_PTR(-ENOMEM);
}
-void btrfs_close_extra_devices(struct btrfs_fs_devices *fs_devices, int step)
+/*
+ * After we have read the system tree and know devids belonging to
+ * this fsid, remove the device which does not belong to this fsid.
+ */
+void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step)
{
struct btrfs_device *device, *next;
struct btrfs_device *latest_dev = NULL;
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index efe4168def6d..9b02791046dc 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -429,7 +429,7 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
struct btrfs_fs_devices **fs_devices_ret);
int btrfs_close_devices(struct btrfs_fs_devices *fs_devices);
-void btrfs_close_extra_devices(struct btrfs_fs_devices *fs_devices, int step);
+void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step);
void btrfs_assign_next_active_device(struct btrfs_fs_info *fs_info,
struct btrfs_device *device, struct btrfs_device *this_dev);
int btrfs_find_device_missing_or_by_path(struct btrfs_fs_info *fs_info,
--
2.15.0
next prev parent reply other threads:[~2018-02-27 4:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-27 4:32 [PATCH] btrfs: rename btrfs_close_extra_device to btrfs_free_extra_devids Anand Jain
2018-02-27 4:41 ` Anand Jain [this message]
2018-03-05 21:28 ` [PATCH v2] " David Sterba
2018-03-01 4:42 ` [PATCH] " kbuild test robot
2018-03-01 6:16 ` Anand Jain
2018-03-03 11:03 ` 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=20180227044159.27975-1-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).