Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp32866pxv; Wed, 14 Jul 2021 22:14:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxc/1HIzigUzH9uY6g4ysZ+L9A6N32H4y5VfBq2u2wF+vpX8U3r1LDYZV+RJxPpBCEg67jq X-Received: by 2002:a17:906:cc15:: with SMTP id ml21mr3107519ejb.49.1626326095210; Wed, 14 Jul 2021 22:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626326095; cv=none; d=google.com; s=arc-20160816; b=UfGKm0fnmoCTd4Dtj9X/2eOj7Q1wHoKeNav3rNNs6jz8xKg87ySyGI3iJ1+B0ZbWx+ m+UcXW7RUYVdMMNLDlgCuX6vdKNURMtNPtD3oApC4xhPlO0m+af1iPTO+Bpqe0/0G5B7 GayraJ/FjaVkKNl7xaDXqeVf2MS8OAzQjVmadlIO4n889xGLOovH/c9xmu3Q0pW5ZNgS xtcsMANhG/r8b8ztWQwiBxbr9Yv1aFXAI0mUGrcBxtZfjvhOJT8Z8uDoVS2wu+ME0FZ/ qYFlQ8jwM67AqU8+g0CHd8fUASX3jeYHpw2aTwv1wXpSp7ncZR5dkmGAu5KAT+WEk9Zo PK1Q== 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=Q6r2jxrfHSNZSwMgkMnKOeji/maSX51+FKKyiv0w1Kw=; b=PqWsJRcdgkPFLoznGXKcphQQxK/fcYIKOoiERJB6BaNcxEry6rLRM4tl0+CCiS1pEY +7C6OiHUeNyjZNXSS/AR7u5kvXoeregkeS+PtpJkHXeMNrQZ7za3tKS3rhMjrxhtkcky fcDGAlMTxVznwhYq2K/kveuw5RSmWbyBnrnBcrOsDvDqeOSD60vN8BbjIrL5+0RrJvx6 GDSMYI//TWaRBN1Ay0O7Vtrf84REq9p1eR337AFqTPunCBKV0WzKMSEoVFb0aInrYrrv xXFy353SJYMj3zbKZdOZ+YCWohuccKuopYQfaeTEhfo9QXhd2E6JAMIAj4L+pMPWQv3X dcqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uRhk2gPU; 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 s8si5554155edr.527.2021.07.14.22.14.30; Wed, 14 Jul 2021 22:14:55 -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=uRhk2gPU; 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 S238300AbhGOEyg (ORCPT + 99 others); Thu, 15 Jul 2021 00:54:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231416AbhGOEyg (ORCPT ); Thu, 15 Jul 2021 00:54:36 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E179FC06175F; Wed, 14 Jul 2021 21:51:43 -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=Q6r2jxrfHSNZSwMgkMnKOeji/maSX51+FKKyiv0w1Kw=; b=uRhk2gPU5CW9kYuqZzi7GUJMsO no0aQ36mKokkXJMhcrPBDcWMMxJLuZMDMpPAQeo1GChL5Dxy7es9pw/yi1w7ZaguIo4Y3XEh9clyF pWGmXDwVOmk/y/MEx+d1RD3/8Wb5z8zmY6VCe2iRKvXgwnjV0PgqI3VeKdy6BZnlfByPAQhF2rPUd rYJSAxZ5BR/7dx0nx3x2OLivyXcpeyk/AuXj4OHz0CiWaI9moQ7eEie9DezmAWGXJwI7PRhQAo8eH 7IOYBjD7cB3IM+VUahU+oI/D/eaN/3fi8LC3JXmUv6EoudsCsc7PpTJ5W43PIhoLKSVRfkSBQ5x+U Gr7KymkQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3tKD-002ysw-84; Thu, 15 Jul 2021 04:50:33 +0000 From: "Matthew Wilcox (Oracle)" To: linux-kernel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v14 093/138] iomap: Convert iomap_page_create to take a folio Date: Thu, 15 Jul 2021 04:36:19 +0100 Message-Id: <20210715033704.692967-94-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210715033704.692967-1-willy@infradead.org> References: <20210715033704.692967-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 function already assumed it was being passed a head page, so just formalise that. Signed-off-by: Matthew Wilcox (Oracle) --- fs/iomap/buffered-io.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index cd5c2f24cb7e..c15a0ac52a32 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -42,11 +42,10 @@ static inline struct iomap_page *to_iomap_page(struct folio *folio) static struct bio_set iomap_ioend_bioset; static struct iomap_page * -iomap_page_create(struct inode *inode, struct page *page) +iomap_page_create(struct inode *inode, struct folio *folio) { - struct folio *folio = page_folio(page); struct iomap_page *iop = to_iomap_page(folio); - unsigned int nr_blocks = i_blocks_per_page(inode, page); + unsigned int nr_blocks = i_blocks_per_folio(inode, folio); if (iop || nr_blocks <= 1) return iop; @@ -54,9 +53,9 @@ iomap_page_create(struct inode *inode, struct page *page) iop = kzalloc(struct_size(iop, uptodate, BITS_TO_LONGS(nr_blocks)), GFP_NOFS | __GFP_NOFAIL); spin_lock_init(&iop->uptodate_lock); - if (PageUptodate(page)) + if (folio_test_uptodate(folio)) bitmap_fill(iop->uptodate, nr_blocks); - attach_page_private(page, iop); + folio_attach_private(folio, iop); return iop; } @@ -235,7 +234,8 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data, { struct iomap_readpage_ctx *ctx = data; struct page *page = ctx->cur_page; - struct iomap_page *iop = iomap_page_create(inode, page); + struct folio *folio = page_folio(page); + struct iomap_page *iop = iomap_page_create(inode, folio); bool same_page = false, is_contig = false; loff_t orig_pos = pos; unsigned poff, plen; @@ -547,7 +547,8 @@ static int __iomap_write_begin(struct inode *inode, loff_t pos, unsigned len, int flags, struct page *page, struct iomap *srcmap) { - struct iomap_page *iop = iomap_page_create(inode, page); + struct folio *folio = page_folio(page); + struct iomap_page *iop = iomap_page_create(inode, folio); loff_t block_size = i_blocksize(inode); loff_t block_start = round_down(pos, block_size); loff_t block_end = round_up(pos + len, block_size); @@ -955,6 +956,7 @@ iomap_page_mkwrite_actor(struct inode *inode, loff_t pos, loff_t length, void *data, struct iomap *iomap, struct iomap *srcmap) { struct page *page = data; + struct folio *folio = page_folio(page); int ret; if (iomap->flags & IOMAP_F_BUFFER_HEAD) { @@ -964,7 +966,7 @@ iomap_page_mkwrite_actor(struct inode *inode, loff_t pos, loff_t length, block_commit_write(page, 0, length); } else { WARN_ON_ONCE(!PageUptodate(page)); - iomap_page_create(inode, page); + iomap_page_create(inode, folio); set_page_dirty(page); } -- 2.30.2