From patchwork Wed Mar 5 18:17:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 14003125 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D04425487E for ; Wed, 5 Mar 2025 18:17:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741198677; cv=none; b=BkfI7fpoQe6n+pPzqQOTUXF/3yk543m53YBIQQLJkJAiNjS3ytD232eFdUS9jhlpLJcBcLPKcvIVkKbAuPMkP737tatXL6u9+uLBtkXRDfx3hLyEnX3kp5PSv9EbkEW+s4oZsNWMYg9saVqZ1tWOyrV1KjRnSVYs6mEjMrYSCJA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741198677; c=relaxed/simple; bh=MgWOsgZqI5T8K169gZV9TDzeg88d/7NeM/BpQfmy4nw=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PtjC7F45UxBACdPGIWX2kJ0hgnE78hduEGGycRzVo6nV4MffP+/ZvZyXjSe5aFLRSiOzkHCNfckMnCjDJaxIi4DhXN8oVfcI+MdhrnW0pDFlRkH0d3AT7rm8lbIBF6CTZpLeqzQ/Mw4APFALXGW2060+jVePEW5hPwM3JW/xRI0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KJ2Ii9CX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KJ2Ii9CX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0098C4CED1 for ; Wed, 5 Mar 2025 18:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741198677; bh=MgWOsgZqI5T8K169gZV9TDzeg88d/7NeM/BpQfmy4nw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KJ2Ii9CXvZJS12EFKKsdHjyc5vyCn47nepdXefTsfNRgsEKf5MAqu4AFn4ABKDXFS 6VjkIba//7LQUkOnotJGvBUSf5760IDy/AV35Kj/FHU7V4lPO0tdrTo96eHmubPNHW IYpBjfpv64SJukJWPH5irK/m3ZmEpJSpUwR8iHq5Gh82dFLJBhJDeGx+YTfPUrlBE5 s9E+XsLMQdSc6UwHSKNwaKxpPhViRYvrqbPYItRKlUqGuuThus6VTfsuNcnVX47j+V 77e2/PSmK9MKB8wQ41xUM2QTkwBQjUQxHluU52StqHWHiQVRwRp1jZ8TZMCn/rQmGX 4QdHADNhpC2gg== From: fdmanana@kernel.org To: linux-btrfs@vger.kernel.org Subject: [PATCH v2 3/4] btrfs: move __btrfs_bio_end_io() code into its single caller Date: Wed, 5 Mar 2025 18:17:49 +0000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Filipe Manana The __btrfs_bio_end_io() helper is trivial and has a single caller, so there's no point in having a dedicated helper function. Further the double underscore prefix in the name is discouraged. So get rid of it and move its code into the caller (btrfs_bio_end_io()). Signed-off-by: Filipe Manana --- fs/btrfs/bio.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index 2f32ee215c3f..07bbb0da2812 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -105,18 +105,6 @@ static void btrfs_cleanup_bio(struct btrfs_bio *bbio) bio_put(&bbio->bio); } -static void __btrfs_bio_end_io(struct btrfs_bio *bbio) -{ - if (bbio_has_ordered_extent(bbio)) { - struct btrfs_ordered_extent *ordered = bbio->ordered; - - bbio->end_io(bbio); - btrfs_put_ordered_extent(ordered); - } else { - bbio->end_io(bbio); - } -} - void btrfs_bio_end_io(struct btrfs_bio *bbio, blk_status_t status) { bbio->bio.bi_status = status; @@ -138,7 +126,15 @@ void btrfs_bio_end_io(struct btrfs_bio *bbio, blk_status_t status) /* Load split bio's error which might be set above. */ if (status == BLK_STS_OK) bbio->bio.bi_status = READ_ONCE(bbio->status); - __btrfs_bio_end_io(bbio); + + if (bbio_has_ordered_extent(bbio)) { + struct btrfs_ordered_extent *ordered = bbio->ordered; + + bbio->end_io(bbio); + btrfs_put_ordered_extent(ordered); + } else { + bbio->end_io(bbio); + } } }