Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3455159pxb; Mon, 1 Nov 2021 14:11:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3BQj/Op1Upzse4Ga1GX4499ZjWoerScLGOkJ5E+nQO6QRECRHM28xDFY9ptGoS56/pvx4 X-Received: by 2002:a5d:91ca:: with SMTP id k10mr23034083ior.25.1635801065496; Mon, 01 Nov 2021 14:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635801065; cv=none; d=google.com; s=arc-20160816; b=pX+gINnBRqTvDJZG2+htwNL0M6X/SFkYfeX83r6dDuNECPG8Sq0TiqEEqxZobORNer h9THLetuk95YY73dr19tcbK0QGKo7jQ9hLJPf6csd48HHDm7QI7XOPXhGGpjQNyNhUEK 6ZMgsXET0+1nOhsjxunVLe251r/wFByr+SB2iRioWjrfleSy99h4qTy3+OXwh0rVTUl7 ZZSB/qVChfWHVvKK0/pazeGpEloleR4W5CpKR8AhJcvf7TH4EeuDOptjFnAvQ/1iNVWo V6RK4PwCNppFHU/Xuj3shzucs16oQYSDM/dK3a3pMmGyE+86Ix5RRZCC3LPZDTErfdNG lyQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=h+3jEzr7Ilau2SMq9EN4URkBu41FqQD5AgM5YMD1zSU=; b=pWmvxIhVX5+3yxt8WSzUteLKvpLUGZ0fgFNiwgTT9k2MpEwX82JqWiYRSjJLuLg8ef bDSbpk3PueIplhTmY8wOOhYIg4PukuJIqUzNyP5u6i1nCbrax+onTI9GsjRqTyf71WMA WCNHLogOFcGU8WkO6pJDWDhxmHC72yw1nYjetyg28dE/BJRA6DfiAV+VY7zeKJ5Z07Nj 5TDOpSwJAsQLZfq4RtMOYpJ0Rg5x8lEVhejlGxL38EKMHgF8h1FvBAEyQMCKX35rakRD wOfpKUEtZacm85wmoA3KNuT6/Cg5EoL0Ndhuh+rFdI1fUcjipq8ZPqIKPR2ucIVwDNEY 3Gqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=r9QXxXhn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q2si15462175jat.117.2021.11.01.14.10.54; Mon, 01 Nov 2021 14:11:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=r9QXxXhn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231220AbhKAVMZ (ORCPT + 99 others); Mon, 1 Nov 2021 17:12:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230281AbhKAVMY (ORCPT ); Mon, 1 Nov 2021 17:12:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1172C061714; Mon, 1 Nov 2021 14:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=h+3jEzr7Ilau2SMq9EN4URkBu41FqQD5AgM5YMD1zSU=; b=r9QXxXhnq8S6YxshRFsqVLd0/u ERwp3f/NV7e5f/OPflRaXt7LJB7e1VskWMSGw617BDnb6Fs/EdftrvPSl17nsBMk/BGmANtdA4G41 +7zDUjd9aQkMis4qxGOSsOPDZd6EzCMtuXACGf08PA37LKLCDMw4cVNbZtS2w996+HCULhWXuBJ2E md9KZafIMiN3er8Pxrm1xfKLA2efKmv6pmYg/HBNM1TOp6rs4JHekipDGI39VS9Z7q7aLTo1SUnUE A7GkTFv4vHqI+l6SzbQRJfrufcXlkQhXMAmEp1F7pOCnPWGZWXgImguHFlp7tuipDfie/8HBL2NF5 B+Y0Fprw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mheV5-0041qA-H7; Mon, 01 Nov 2021 21:06:44 +0000 From: "Matthew Wilcox (Oracle)" To: "Darrick J. Wong" Cc: "Matthew Wilcox (Oracle)" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig Subject: [PATCH 16/21] iomap: Convert iomap_write_end_inline to take a folio Date: Mon, 1 Nov 2021 20:39:24 +0000 Message-Id: <20211101203929.954622-17-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211101203929.954622-1-willy@infradead.org> References: <20211101203929.954622-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This conversion is only safe because iomap only supports writes to inline data which starts at the beginning of the file. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong --- fs/iomap/buffered-io.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 6df8fdbb1951..6862487f4067 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -675,16 +675,16 @@ static size_t __iomap_write_end(struct inode *inode, loff_t pos, size_t len, } static size_t iomap_write_end_inline(const struct iomap_iter *iter, - struct page *page, loff_t pos, size_t copied) + struct folio *folio, loff_t pos, size_t copied) { const struct iomap *iomap = &iter->iomap; void *addr; - WARN_ON_ONCE(!PageUptodate(page)); + WARN_ON_ONCE(!folio_test_uptodate(folio)); BUG_ON(!iomap_inline_data_valid(iomap)); - flush_dcache_page(page); - addr = kmap_local_page(page) + pos; + flush_dcache_folio(folio); + addr = kmap_local_folio(folio, pos); memcpy(iomap_inline_data(iomap, pos), addr, copied); kunmap_local(addr); @@ -703,7 +703,7 @@ static size_t iomap_write_end(struct iomap_iter *iter, loff_t pos, size_t len, size_t ret; if (srcmap->type == IOMAP_INLINE) { - ret = iomap_write_end_inline(iter, page, pos, copied); + ret = iomap_write_end_inline(iter, folio, pos, copied); } else if (srcmap->flags & IOMAP_F_BUFFER_HEAD) { ret = block_write_end(NULL, iter->inode->i_mapping, pos, len, copied, page, NULL); -- 2.33.0