From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 02/15] btrfs: rename struct btrfs_fs_devices::list
Date: Thu, 12 Apr 2018 10:29:25 +0800 [thread overview]
Message-ID: <20180412022938.8257-3-anand.jain@oracle.com> (raw)
In-Reply-To: <20180412022938.8257-1-anand.jain@oracle.com>
btrfs_fs_devices::list is the list of BTRFS fsid in the kernel, a generic
name 'list' makes it's search very difficult, rename it to fs_list.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
fs/btrfs/sysfs.c | 2 +-
fs/btrfs/volumes.c | 16 ++++++++--------
fs/btrfs/volumes.h | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index ca067471cd46..ba14d79cf5d2 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -602,7 +602,7 @@ void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs)
return;
}
- list_for_each_entry(fs_devs, fs_uuids, list) {
+ list_for_each_entry(fs_devs, fs_uuids, fs_list) {
__btrfs_sysfs_remove_fsid(fs_devs);
}
}
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 7ccd1a38c634..aacaf6c9feb7 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -232,7 +232,7 @@ static struct btrfs_fs_devices *alloc_fs_devices(const u8 *fsid)
INIT_LIST_HEAD(&fs_devs->devices);
INIT_LIST_HEAD(&fs_devs->resized_devices);
INIT_LIST_HEAD(&fs_devs->alloc_list);
- INIT_LIST_HEAD(&fs_devs->list);
+ INIT_LIST_HEAD(&fs_devs->fs_list);
if (fsid)
memcpy(fs_devs->fsid, fsid, BTRFS_FSID_SIZE);
@@ -278,8 +278,8 @@ void __exit btrfs_cleanup_fs_uuids(void)
while (!list_empty(&fs_uuids)) {
fs_devices = list_entry(fs_uuids.next,
- struct btrfs_fs_devices, list);
- list_del(&fs_devices->list);
+ struct btrfs_fs_devices, fs_list);
+ list_del(&fs_devices->fs_list);
free_fs_devices(fs_devices);
}
}
@@ -348,7 +348,7 @@ static noinline struct btrfs_fs_devices *find_fsid(u8 *fsid)
{
struct btrfs_fs_devices *fs_devices;
- list_for_each_entry(fs_devices, &fs_uuids, list) {
+ list_for_each_entry(fs_devices, &fs_uuids, fs_list) {
if (memcmp(fsid, fs_devices->fsid, BTRFS_FSID_SIZE) == 0)
return fs_devices;
}
@@ -612,7 +612,7 @@ static void btrfs_free_stale_devices(const char *path,
struct btrfs_fs_devices *fs_devs, *tmp_fs_devs;
struct btrfs_device *dev, *tmp_dev;
- list_for_each_entry_safe(fs_devs, tmp_fs_devs, &fs_uuids, list) {
+ list_for_each_entry_safe(fs_devs, tmp_fs_devs, &fs_uuids, fs_list) {
if (fs_devs->opened)
continue;
@@ -637,7 +637,7 @@ static void btrfs_free_stale_devices(const char *path,
/* delete the stale device */
if (fs_devs->num_devices == 1) {
btrfs_sysfs_remove_fsid(fs_devs);
- list_del(&fs_devs->list);
+ list_del(&fs_devs->fs_list);
free_fs_devices(fs_devs);
break;
} else {
@@ -737,7 +737,7 @@ static noinline struct btrfs_device *device_list_add(const char *path,
if (IS_ERR(fs_devices))
return ERR_CAST(fs_devices);
- list_add(&fs_devices->list, &fs_uuids);
+ list_add(&fs_devices->fs_list, &fs_uuids);
device = NULL;
} else {
@@ -2256,7 +2256,7 @@ static int btrfs_prepare_sprout(struct btrfs_fs_info *fs_info)
return PTR_ERR(old_devices);
}
- list_add(&old_devices->list, &fs_uuids);
+ list_add(&old_devices->fs_list, &fs_uuids);
memcpy(seed_devices, fs_devices, sizeof(*seed_devices));
seed_devices->opened = 1;
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index 681be2dc0c6a..ef220d541d4b 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -221,6 +221,7 @@ BTRFS_DEVICE_GETSET_FUNCS(bytes_used);
struct btrfs_fs_devices {
u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
+ struct list_head fs_list;
u64 num_devices;
u64 open_devices;
@@ -242,7 +243,6 @@ struct btrfs_fs_devices {
struct list_head resized_devices;
/* devices not currently being allocated */
struct list_head alloc_list;
- struct list_head list;
struct btrfs_fs_devices *seed;
int seeding;
--
2.7.0
next prev parent reply other threads:[~2018-04-12 2:27 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-12 2:29 [PATCH 0/15] Review uuid_mutex usage Anand Jain
2018-04-12 2:29 ` [PATCH 01/15] btrfs: optimize move uuid_mutex closer to the critical section Anand Jain
2018-04-12 2:29 ` Anand Jain [this message]
2018-04-12 2:29 ` [PATCH 03/15] btrfs: cleanup __btrfs_open_devices() drop head pointer Anand Jain
2018-04-12 2:29 ` [PATCH 04/15] btrfs: rename __btrfs_close_devices to close_fs_devices Anand Jain
2018-04-12 2:29 ` [PATCH 05/15] btrfs: rename __btrfs_open_devices to open_fs_devices Anand Jain
2018-04-12 2:29 ` [PATCH 06/15] btrfs: cleanup find_device() drop list_head pointer Anand Jain
2018-04-12 2:29 ` [PATCH 07/15] btrfs: cleanup btrfs_rm_device() promote fs_devices pointer Anand Jain
2018-04-12 2:29 ` [PATCH 08/15] btrfs: cleanup btrfs_rm_device() use cur_devices Anand Jain
2018-04-12 2:29 ` [PATCH 09/15] btrfs: uuid_mutex in read_chunk_tree, add a comment Anand Jain
2018-04-12 2:29 ` [PATCH 10/15] btrfs: drop uuid_mutex in btrfs_free_extra_devids() Anand Jain
2018-05-15 16:26 ` David Sterba
2018-05-22 9:11 ` Anand Jain
2018-05-23 2:54 ` [PATCH v3] " Anand Jain
2018-05-25 15:55 ` David Sterba
2018-05-28 10:14 ` [PATCH v4] " Anand Jain
2018-04-12 2:29 ` [PATCH 11/15] btrfs: drop uuid_mutex in btrfs_open_devices() Anand Jain
2018-04-12 2:29 ` [PATCH 12/15] btrfs: drop uuid_mutex in close_fs_devices() Anand Jain
2018-05-15 16:30 ` David Sterba
2018-05-22 9:12 ` Anand Jain
2018-04-12 2:29 ` [PATCH 13/15] btrfs: drop uuid_mutex in btrfs_dev_replace_finishing() Anand Jain
2018-04-12 2:29 ` [PATCH 14/15] btrfs: drop uuid_mutex in btrfs_destroy_dev_replace_tgtdev() Anand Jain
2018-04-12 2:29 ` [PATCH 15/15] btrfs: cleanup btrfs_destroy_dev_replace_tgtdev() localize btrfs_fs_devices Anand Jain
2018-04-16 19:52 ` [PATCH 0/15] Review uuid_mutex usage David Sterba
2018-04-18 9:56 ` [PATCH] btrfs: update uuid_mutex and device_list_mutex comments Anand Jain
2018-04-24 15:48 ` David Sterba
2018-05-16 5:09 ` Anand Jain
2018-04-19 15:22 ` [PATCH 0/15] Review uuid_mutex usage David Sterba
2018-05-15 16:33 ` David Sterba
2018-05-22 9:27 ` 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=20180412022938.8257-3-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).