diff mbox series

[-next] btrfs: Use LIST_HEAD to initialize splice

Message ID 20230809075711.1570163-1-ruanjinjie@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] btrfs: Use LIST_HEAD to initialize splice | expand

Commit Message

Jinjie Ruan Aug. 9, 2023, 7:57 a.m. UTC
Use LIST_HEAD() to initialize splice instead of open-coding it.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
 fs/btrfs/disk-io.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

Comments

David Sterba Aug. 9, 2023, 6:11 p.m. UTC | #1
On Wed, Aug 09, 2023 at 03:57:11PM +0800, Ruan Jinjie wrote:
> Use LIST_HEAD() to initialize splice instead of open-coding it.

Have you checked that there are no remainig conversions? I found 2 more
in btrfs_log_changed_extents() and btrfs_wait_ordered_roots(). Please
add them and resend, thanks.
Jinjie Ruan Aug. 10, 2023, 2:05 a.m. UTC | #2
On 2023/8/10 2:11, David Sterba wrote:
> On Wed, Aug 09, 2023 at 03:57:11PM +0800, Ruan Jinjie wrote:
>> Use LIST_HEAD() to initialize splice instead of open-coding it.
> 
> Have you checked that there are no remainig conversions? I found 2 more
> in btrfs_log_changed_extents() and btrfs_wait_ordered_roots(). Please
> add them and resend, thanks.

Sorry! I'll add them and resend it.
diff mbox series

Patch

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index da51e5750443..89c18ad3f364 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -4541,9 +4541,7 @@  static void btrfs_destroy_ordered_extents(struct btrfs_root *root)
 static void btrfs_destroy_all_ordered_extents(struct btrfs_fs_info *fs_info)
 {
 	struct btrfs_root *root;
-	struct list_head splice;
-
-	INIT_LIST_HEAD(&splice);
+	LIST_HEAD(splice);
 
 	spin_lock(&fs_info->ordered_root_lock);
 	list_splice_init(&fs_info->ordered_roots, &splice);
@@ -4649,9 +4647,7 @@  static void btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
 static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root)
 {
 	struct btrfs_inode *btrfs_inode;
-	struct list_head splice;
-
-	INIT_LIST_HEAD(&splice);
+	LIST_HEAD(splice);
 
 	spin_lock(&root->delalloc_lock);
 	list_splice_init(&root->delalloc_inodes, &splice);
@@ -4684,9 +4680,7 @@  static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root)
 static void btrfs_destroy_all_delalloc_inodes(struct btrfs_fs_info *fs_info)
 {
 	struct btrfs_root *root;
-	struct list_head splice;
-
-	INIT_LIST_HEAD(&splice);
+	LIST_HEAD(splice);
 
 	spin_lock(&fs_info->delalloc_root_lock);
 	list_splice_init(&fs_info->delalloc_roots, &splice);