linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: fdmanana@kernel.org
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 11/24] btrfs: remove redundant counter check at btrfs_truncate_inode_items()
Date: Tue, 21 Mar 2023 11:13:47 +0000	[thread overview]
Message-ID: <0618e34a343facf5c7ee34d0021ed6476c655a55.1679326432.git.fdmanana@suse.com> (raw)
In-Reply-To: <cover.1679326426.git.fdmanana@suse.com>

From: Filipe Manana <fdmanana@suse.com>

At btrfs_truncate_inode_items(), in the while loop when we decide that we
are going to delete an item, it's pointless to check that 'pending_del_nr'
is non-zero in an else clause because the corresponding if statement is
checking if 'pending_del_nr' has a value of zero. So just remove that
condition from the else clause.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/inode-item.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
index b65c45b5d681..b27c2c560083 100644
--- a/fs/btrfs/inode-item.c
+++ b/fs/btrfs/inode-item.c
@@ -660,8 +660,7 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
 				/* No pending yet, add ourselves */
 				pending_del_slot = path->slots[0];
 				pending_del_nr = 1;
-			} else if (pending_del_nr &&
-				   path->slots[0] + 1 == pending_del_slot) {
+			} else if (path->slots[0] + 1 == pending_del_slot) {
 				/* Hop on the pending chunk */
 				pending_del_nr++;
 				pending_del_slot = path->slots[0];
-- 
2.34.1


  parent reply	other threads:[~2023-03-21 11:14 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 11:13 [PATCH 00/24] btrfs: cleanups and small fixes mostly around block reserves fdmanana
2023-03-21 11:13 ` [PATCH 01/24] btrfs: pass a bool to btrfs_block_rsv_migrate() at evict_refill_and_join() fdmanana
2023-03-21 11:40   ` Anand Jain
2023-03-21 12:18   ` Johannes Thumshirn
2023-03-21 11:13 ` [PATCH 02/24] btrfs: pass a bool size update argument to btrfs_block_rsv_add_bytes() fdmanana
2023-03-21 11:43   ` Anand Jain
2023-03-21 12:18   ` Johannes Thumshirn
2023-03-21 11:13 ` [PATCH 03/24] btrfs: remove check for NULL block reserve at btrfs_block_rsv_check() fdmanana
2023-03-21 11:48   ` Anand Jain
2023-03-21 11:54   ` Anand Jain
2023-03-21 12:19   ` Johannes Thumshirn
2023-03-21 11:13 ` [PATCH 04/24] btrfs: update documentation for BTRFS_RESERVE_FLUSH_EVICT flush method fdmanana
2023-03-21 12:19   ` Johannes Thumshirn
2023-03-21 11:13 ` [PATCH 05/24] btrfs: update flush method assertion when reserving space fdmanana
2023-03-21 11:13 ` [PATCH 06/24] btrfs: initialize ret to -ENOSPC at __reserve_bytes() fdmanana
2023-03-21 12:24   ` Johannes Thumshirn
2023-03-21 12:43   ` Anand Jain
2023-03-21 11:13 ` [PATCH 07/24] btrfs: simplify btrfs_should_throttle_delayed_refs() fdmanana
2023-03-21 12:52   ` Anand Jain
2023-03-21 11:13 ` [PATCH 08/24] btrfs: collapse should_end_transaction() into btrfs_should_end_transaction() fdmanana
2023-03-21 13:00   ` Anand Jain
2023-03-21 11:13 ` [PATCH 09/24] btrfs: remove bytes_used argument from btrfs_make_block_group() fdmanana
2023-03-21 13:05   ` Anand Jain
2023-03-21 11:13 ` [PATCH 10/24] btrfs: count extents before taking inode's spinlock when reserving metadata fdmanana
2023-03-21 13:26   ` Anand Jain
2023-03-21 11:13 ` fdmanana [this message]
2023-03-21 13:31   ` [PATCH 11/24] btrfs: remove redundant counter check at btrfs_truncate_inode_items() Anand Jain
2023-03-21 11:13 ` [PATCH 12/24] btrfs: simplify btrfs_block_rsv_refill() fdmanana
2023-03-21 13:40   ` Anand Jain
2023-03-21 11:13 ` [PATCH 13/24] btrfs: remove obsolete delayed ref throttling logic when truncating items fdmanana
2023-03-21 11:13 ` [PATCH 14/24] btrfs: don't throttle on delayed items when evicting deleted inode fdmanana
2023-03-21 11:13 ` [PATCH 15/24] btrfs: calculate the right space for a single delayed ref when refilling fdmanana
2023-03-21 13:59   ` Anand Jain
2023-03-21 11:13 ` [PATCH 16/24] btrfs: accurately calculate number of delayed refs when flushing fdmanana
2023-03-21 11:13 ` [PATCH 17/24] btrfs: constify fs_info argument of the metadata size calculation helpers fdmanana
2023-03-21 15:09   ` Anand Jain
2023-03-21 11:13 ` [PATCH 18/24] btrfs: constify fs_info argument for the reclaim items " fdmanana
2023-03-21 14:24   ` Anand Jain
2023-03-21 11:13 ` [PATCH 19/24] btrfs: add helper to calculate space for delayed references fdmanana
2023-03-21 11:13 ` [PATCH 20/24] btrfs: calculate correct amount of space for delayed reference when evicting fdmanana
2023-03-21 11:13 ` [PATCH 21/24] btrfs: fix calculation of the global block reserve's size fdmanana
2023-03-21 11:13 ` [PATCH 22/24] btrfs: use a constant for the number of metadata units needed for an unlink fdmanana
2023-03-21 14:37   ` Anand Jain
2023-03-21 11:13 ` [PATCH 23/24] btrfs: calculate the right space for delayed refs when updating global reserve fdmanana
2023-03-21 11:14 ` [PATCH 24/24] btrfs: simplify exit paths of btrfs_evict_inode() fdmanana
2023-03-22 14:37 ` [PATCH 00/24] btrfs: cleanups and small fixes mostly around block reserves Josef Bacik
2023-03-23 19:35 ` David Sterba

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=0618e34a343facf5c7ee34d0021ed6476c655a55.1679326432.git.fdmanana@suse.com \
    --to=fdmanana@kernel.org \
    --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).