Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH -next] btrfs: Use LIST_HEAD to initialize splice
@ 2023-08-09  7:57 Ruan Jinjie
  2023-08-09 18:11 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Ruan Jinjie @ 2023-08-09  7:57 UTC (permalink / raw)
  To: linux-btrfs, Chris Mason, Josef Bacik, David Sterba; +Cc: ruanjinjie

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(-)

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);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] btrfs: Use LIST_HEAD to initialize splice
  2023-08-09  7:57 [PATCH -next] btrfs: Use LIST_HEAD to initialize splice Ruan Jinjie
@ 2023-08-09 18:11 ` David Sterba
  2023-08-10  2:05   ` Ruan Jinjie
  0 siblings, 1 reply; 3+ messages in thread
From: David Sterba @ 2023-08-09 18:11 UTC (permalink / raw)
  To: Ruan Jinjie; +Cc: linux-btrfs, Chris Mason, Josef Bacik, David Sterba

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] btrfs: Use LIST_HEAD to initialize splice
  2023-08-09 18:11 ` David Sterba
@ 2023-08-10  2:05   ` Ruan Jinjie
  0 siblings, 0 replies; 3+ messages in thread
From: Ruan Jinjie @ 2023-08-10  2:05 UTC (permalink / raw)
  To: dsterba, linux-btrfs, Chris Mason, Josef Bacik, David Sterba



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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-10  2:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-09  7:57 [PATCH -next] btrfs: Use LIST_HEAD to initialize splice Ruan Jinjie
2023-08-09 18:11 ` David Sterba
2023-08-10  2:05   ` Ruan Jinjie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox