From patchwork Mon May 8 16:08:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13234749 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4CADC7EE24 for ; Mon, 8 May 2023 16:09:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233790AbjEHQJQ (ORCPT ); Mon, 8 May 2023 12:09:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233442AbjEHQI7 (ORCPT ); Mon, 8 May 2023 12:08:59 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9BE46A63 for ; Mon, 8 May 2023 09:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=xta5Lb2860oItYhGC8MyezxwVln/x6CpnyEoF4ifLro=; b=ma2Euz8K6djNCvwWyUUzBX3M7+ pAHcBd1/x9g9EdeeX9Xao0d0to/hsfZVmxOOuSkR0eSGZkAQh8++c2W83O0lGBKvrqGIfuPcihRdG WuNBm0HL7YcxSeT3wmQ4AAYotjEal3f1WhPlUJiqVLWNjzhexZYckRxSas1hJjhy06iGJNQBjnozF Krb+lgmbuasQ8YwTa3cs3Rbd9KPZx2egER7SUIx5exC8t7gNHzDlqFNKjjrPlPai2MY2mRZbLe0rE ezvUVsjSDsYhswc0F9j/lzeHJL8JTzVw8qmCdCxXMs46J5SR5FXSdYTvkMEhdMC4ZOe19bwhQerdN LrcsifeQ==; Received: from [208.98.210.70] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pw3Q1-000w52-1i; Mon, 08 May 2023 16:08:57 +0000 From: Christoph Hellwig To: Chris Mason , Josef Bacik , David Sterba Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 21/21] btrfs: use btrfs_finish_ordered_extent to complete buffered writes Date: Mon, 8 May 2023 09:08:43 -0700 Message-Id: <20230508160843.133013-22-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230508160843.133013-1-hch@lst.de> References: <20230508160843.133013-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Use the btrfs_finish_ordered_extent helper to complete compressed writes using the bbio->ordered pointer instead of requiring an rbtree lookup in the otherwise equivalent btrfs_mark_ordered_io_finished called from btrfs_writepage_endio_finish_ordered. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- fs/btrfs/extent_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index f02564ad194050..7a3a40c2eb7ff5 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -595,8 +595,8 @@ static void end_bio_extent_writepage(struct btrfs_bio *bbio) "incomplete page write with offset %u and length %u", bvec->bv_offset, bvec->bv_len); - btrfs_writepage_endio_finish_ordered(BTRFS_I(inode), page, start, - start + len - 1, !error); + btrfs_finish_ordered_extent(bbio->ordered, page, start, len, + !error); if (error) { btrfs_page_clear_uptodate(fs_info, page, start, len); btrfs_page_set_error(fs_info, page, start, len);