diff mbox series

[2/3] btrfs: remove list emptyness check at warn_about_uncommitted_trans()

Message ID 2499553abf53fc8bfd112a0c16f07b225de01aba.1712145320.git.fdmanana@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs: remove some unused and pointless code | expand

Commit Message

Filipe Manana April 3, 2024, 12:05 p.m. UTC
From: Filipe Manana <fdmanana@suse.com>

At warn_about_uncommitted_trans(), there's no need to check if the list
is empty and return, because list_for_each_entry_safe() is safe to call
for an empty list, it simply does nothing. So remove the check.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/disk-io.c | 3 ---
 1 file changed, 3 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 5a35c2c0bbc9..0474e9b6d302 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -4182,9 +4182,6 @@  static void warn_about_uncommitted_trans(struct btrfs_fs_info *fs_info)
 	struct btrfs_transaction *tmp;
 	bool found = false;
 
-	if (list_empty(&fs_info->trans_list))
-		return;
-
 	/*
 	 * This function is only called at the very end of close_ctree(),
 	 * thus no other running transaction, no need to take trans_lock.