From patchwork Mon Feb 10 13:34:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13967944 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 86C0222FF52; Mon, 10 Feb 2025 13:35:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194502; cv=none; b=qoE2Ugepue4XBAuxYnJ4bfoZoR+O1zXfgAESFVGs4FIQ8LADhy+AK62YhkWFSED7XpunpBwCcHxyxwKaU6r58IxfqBoDKZIpT+Sv2PRW3bXFyBdL340xeuOCeoYtvS1BiJFg790R+owrVVparttAXJUGjIL1RLzQHfFbbjMtpj4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194502; c=relaxed/simple; bh=ATmhb9nW9MjSGidjnsF4t5/t8NVQeEGlTw4KWWgJJ0Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k56OJuLb0GcL8pnLvn1t7pH4CUMWKsr3l2zNr9vKFEX1aYu7HPRMx1SaLulpbkZnbehmJYKK+9WxLeyTIa1ZzpTnu4LQh3klZySUG7+f+xCJDu5j9t8iESkemQbQpZHsK+3g9ikeby8Xfppc58+I4AXkAYWsQGRICbrzx2LGJ+k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=gpUQuPGZ; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="gpUQuPGZ" 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=hkLLwz4FFsmHh0s+2BRr5HbmcKpKIBWVZXDLMNKIqzA=; b=gpUQuPGZORfP33/kdQ7HHHYPvT SGRXWL6MROQEYdGLlA45PJPuLQuaGdwAuNsHPDyjMsTmCF2avUw042hKnYpHcUTrLEIqyRXieHsVX SdotHRXhCI/qHbaCQuK3zWMPKk/bLojXFGafnADnG0yMVhnTOEuFvmgUfUg7wVT0arFBYLn4039FO nXvQkaelEKqbC5Wex7E3OE6+SywbVbwpsO1WAFMGM1O+Zp14iHEmJ9xLPNjmsa6IbD11jmvQ30tJp So0tRFwPRsMm73ygrCOz6tQk9Fwq3v7Cta7h0U547O819+FUGrKEwkJEP31k8Fvv5FKjm5uVj/t0Z waBoB4Ow==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1thTw5-0000000FvZo-37uD; Mon, 10 Feb 2025 13:34:53 +0000 From: "Matthew Wilcox (Oracle)" To: Andreas Gruenbacher Cc: "Matthew Wilcox (Oracle)" , gfs2@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: [PATCH 1/8] gfs2: Use b_folio in gfs2_log_write_bh() Date: Mon, 10 Feb 2025 13:34:39 +0000 Message-ID: <20250210133448.3796209-2-willy@infradead.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250210133448.3796209-1-willy@infradead.org> References: <20250210133448.3796209-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 We are preparing to remove bh->b_page. gfs2_log_write() should continue to operate on pages as some of the memory being logged does not come from folios, so convert from folio to page in this function. Signed-off-by: Matthew Wilcox (Oracle) --- fs/gfs2/lops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 314ec2a70167..d27f34688ff5 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -359,8 +359,8 @@ static void gfs2_log_write_bh(struct gfs2_sbd *sdp, struct buffer_head *bh) dblock = gfs2_log_bmap(sdp->sd_jdesc, sdp->sd_log_flush_head); gfs2_log_incr_head(sdp); - gfs2_log_write(sdp, sdp->sd_jdesc, bh->b_page, bh->b_size, - bh_offset(bh), dblock); + gfs2_log_write(sdp, sdp->sd_jdesc, folio_page(bh->b_folio, 0), + bh->b_size, bh_offset(bh), dblock); } /** From patchwork Mon Feb 10 13:34:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13967943 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 8BD3722FF58; Mon, 10 Feb 2025 13:34:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194500; cv=none; b=n2KdRCba2O9748BS/r7ybJgfDglgzJAcJBVordmm32tLlSrszNj7KKDRH0Qmu0BwKFN7qA5PClf6CjAm+1FG94jF6j7VJrHg+BvNm7WlCSMz2yFtQ3zGI28YVK+eJhEQ/USJdaT1yryqWP/qDzhx0+S6jKsRoBtwcQYG1cseZzg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194500; c=relaxed/simple; bh=6YUF1zzOk5DgkFBUw1J2J/Kvch++VLEn+3f4rK3YDIU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TcDdWw6r7lWqrWRWv5Jm1zpLGZQ9+9XlNj1bssUhcCuxbn1tVBInIOknBrjlIOB44zIxcSmVycVfxqPnVC/3sqAEjqLLIws7u+k/gp26m1EgOBWdb5MVjIArL9dGRNSzpY/5AuU5l23FGLOff3zlSEBajCvpLxG8+cPJANwGeIE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Xz6jxeKF; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Xz6jxeKF" 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=6XmXVG2+oMaQiX+JohdVsei/y+eNiOuM15IHE+e0PcU=; b=Xz6jxeKFIH9ZE3GMg7YgZKmFyj NRLqtPh5iEo+yW7HJJcPN2vQvNry12Ou0NNO3rFHqSjcScZwrp8RMR+qwMT69CQeGa+jhaE4J1VDd t8+QJig0btcLvuDSW3CbCPV3j5FIwm7+BiYEY3TAH4r9gNTOKMEXfrTezApBiZ2o3LtfgY25DrK9W 3iQLRSR82zxCrNxRTMUMpY0W7b/no4ZsIlNsPpmwvHIqjKMYwBolNqub+W0olwWb9unQHFRPfqIza 8wNRltkyJo4CSX6xV8br/odvQ0e8uphmv0dQ9u4vToOh3b24q4Bn7sLvNOwCCEu2HDzQUFMWtpsCT zFuoxb4w==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1thTw5-0000000FvZq-3TT6; Mon, 10 Feb 2025 13:34:53 +0000 From: "Matthew Wilcox (Oracle)" To: Andreas Gruenbacher Cc: "Matthew Wilcox (Oracle)" , gfs2@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: [PATCH 2/8] gfs2: Use b_folio in gfs2_trans_add_meta() Date: Mon, 10 Feb 2025 13:34:40 +0000 Message-ID: <20250210133448.3796209-3-willy@infradead.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250210133448.3796209-1-willy@infradead.org> References: <20250210133448.3796209-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The lock bit is maintained on the folio, not on the page. Saves two calls to compound_head() as well as removing two references to bh->b_page. Signed-off-by: Matthew Wilcox (Oracle) --- fs/gfs2/trans.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index 192213c7359a..f8ae2c666fd6 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c @@ -246,12 +246,12 @@ void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh) if (bd == NULL) { gfs2_log_unlock(sdp); unlock_buffer(bh); - lock_page(bh->b_page); + folio_lock(bh->b_folio); if (bh->b_private == NULL) bd = gfs2_alloc_bufdata(gl, bh); else bd = bh->b_private; - unlock_page(bh->b_page); + folio_unlock(bh->b_folio); lock_buffer(bh); gfs2_log_lock(sdp); } From patchwork Mon Feb 10 13:34:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13967945 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 69ABB22FF52; Mon, 10 Feb 2025 13:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194505; cv=none; b=iymnWyxaVz3Q61WUWFYvV+BvsKUPra0ddLIdcq5Te0i2i30j8d1R1UQylUoyUkbTLWQolx5NEHQMpn+fEADV3Bi6MWGRzs2j09g+v+qXvCklL7ZXUTxWaAb1ocK7sFZVJXAxbc47lVjKIBG9XRNVdT3Q2Rm4z+yit2civmXI+44= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194505; c=relaxed/simple; bh=E2eO4+9j80iJ2o4sXbky7mC8xtI7dCikzbB4i+qDbw0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cmyrqzwXrZRYpedwtxEVd6EIBp9y8r+TvZVP/63nwVGPujRS/61oBDUIetv+E/rRyhn7QBQcjqB4wUo3uGeHVVf4Ljr0dtNBvYLAO8WlkGFrJNf0dL5UMfoRZsLXRQz6TLZyubSKCX7vgi8F3ABACYSgEHhONFwQlVdmD4KWT4A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=aoGBQNTG; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="aoGBQNTG" 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=BXOqBE20TDdvRRVcehY9pob5yLtgBqzqb3aZO2uPEyI=; b=aoGBQNTG/Qjhc5Vq7dr6nDcVuf zruAlx8UyTQLm7NrHskPmjYq1sVyLgVGpP4kYnK5UJ1aNotdcjYiLMR27wRaYDSUM2qDOYZBpjZeS 7wteARxKqm/iHV+Bx/jluEo4JOhOIhoFeWofITx3if6slIr3AJJj+UWnoXeZi3J2+Cg56kqm0qdK2 E8NU5q93CQSqA8QZiyCZj5yfgC2WnduJ2iRWAjJFJ+RMALleio4LadO5jHWMI92+EFH6AbnZScLG0 ywR2K1+PnFwvxAI51T2qUrnRRSlHwUXBW01I8VM4SE6GiRu2ErVkG+1ywdmHrDbxUPOLHN4rxbNWW Qg5CMEMw==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1thTw5-0000000FvZs-3q2K; Mon, 10 Feb 2025 13:34:53 +0000 From: "Matthew Wilcox (Oracle)" To: Andreas Gruenbacher Cc: "Matthew Wilcox (Oracle)" , gfs2@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: [PATCH 3/8] gfs2: Use b_folio in gfs2_submit_bhs() Date: Mon, 10 Feb 2025 13:34:41 +0000 Message-ID: <20250210133448.3796209-4-willy@infradead.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250210133448.3796209-1-willy@infradead.org> References: <20250210133448.3796209-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Remove a reference to bh->b_page which is going to be removed soon. Signed-off-by: Matthew Wilcox (Oracle) --- fs/gfs2/meta_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index fea3efcc2f93..66db506a5f7f 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c @@ -232,7 +232,7 @@ static void gfs2_submit_bhs(blk_opf_t opf, struct buffer_head *bhs[], int num) bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); while (num > 0) { bh = *bhs; - if (!bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh))) { + if (!bio_add_folio(bio, bh->b_folio, bh->b_size, bh_offset(bh))) { BUG_ON(bio->bi_iter.bi_size == 0); break; } From patchwork Mon Feb 10 13:34:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13967942 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 B9D7F22FF43; Mon, 10 Feb 2025 13:34:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194498; cv=none; b=ggPLBWEp3pUQpT8fcabFzvZG/qYPZfwAJDUfmDTilygkK6xCdNh+unN5JzlIoRvurl9366FO8wr8o683tNpJsydFZwx2Q9tHRflAK+DISmPXs3v+HjtcJtC/crSWSVi4k+j8tkteNE5/pAJYa2TVf0VQCqal2W+DySOCfuT56fg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194498; c=relaxed/simple; bh=w7bxwAnZv/QEliC18ASKViHZm3n46+jYgCt/nHSde4w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D5OQs3L6GvO0MPnS721xxIItTGylRAklgsk3nBVBnl2YUmrmcpndHpHshFqOWf+BpqVxaiIqVb3ulrn0HpdgdbHmZedmpbsrvWHIl2gE2MZKI99P7yyKqEAQkxjVyUZK4Zko0mWUBqevWpMXf7IDNH8gmBFxm0bc/xUcoQgTBW4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=HGb77Oi/; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="HGb77Oi/" 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=fyUQp+uL/ZgVZNc447UUj9/Z9HHRPY2gBHROD633lhM=; b=HGb77Oi/Q64MLlVu489bi6gLRT OhVCXsFEqSguLZOKiqcpV8H872uQEbSLfd/JB/5LEUIrDWY3gsM+68UU+wdd/8HINk/XRFrO3+IIJ h3NZHBBhCI6CV9Un0TtRjLSBhTABsApT4jsQtY6s+BjIYiJ+o5QLAQndEy87tx91kGqRkVrklSzly 7pWW+v9+7i3ZVEZU2EfCxc2Sfm6lzmuyDYTx4nIfss3dkmhulJriNwalJVToTGh/N709qDtvIu/DE 08vc24jhaWXOb4kf3e0Jy+E/BvRKyJJAMbVWzar3EnBF3Wm+cjRA7+lSQIV6vEDyudbwVelPcGhjE Z/eVgJ7w==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1thTw6-0000000FvZu-01mc; Mon, 10 Feb 2025 13:34:54 +0000 From: "Matthew Wilcox (Oracle)" To: Andreas Gruenbacher Cc: "Matthew Wilcox (Oracle)" , gfs2@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: [PATCH 4/8] gfs2: Use b_folio in gfs2_check_magic() Date: Mon, 10 Feb 2025 13:34:42 +0000 Message-ID: <20250210133448.3796209-5-willy@infradead.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250210133448.3796209-1-willy@infradead.org> References: <20250210133448.3796209-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 We are preparing to remove bh->b_page. Use kmap_local_folio() instead of kmap_local_page(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/gfs2/lops.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index d27f34688ff5..4123bfc16680 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -615,15 +615,13 @@ static struct page *gfs2_get_log_desc(struct gfs2_sbd *sdp, u32 ld_type, static void gfs2_check_magic(struct buffer_head *bh) { - void *kaddr; __be32 *ptr; clear_buffer_escaped(bh); - kaddr = kmap_local_page(bh->b_page); - ptr = kaddr + bh_offset(bh); + ptr = kmap_local_folio(bh->b_folio, bh_offset(bh)); if (*ptr == cpu_to_be32(GFS2_MAGIC)) set_buffer_escaped(bh); - kunmap_local(kaddr); + kunmap_local(ptr); } static int blocknr_cmp(void *priv, const struct list_head *a, From patchwork Mon Feb 10 13:34:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13967941 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 B9C9422257D; Mon, 10 Feb 2025 13:34:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194498; cv=none; b=F2fTt2bWs1VL+fO1zL64wqRf+7SGK4cj2UFSjWlCexPUjY5wBYXvkKazXFqlJWlGXHPJpSL2ajG3oFmbsHy7Iz7G666bBX9Wz7dcg26fptJ44CFA8xLsB0QX9lVsx03zTDX9sQjZx+sW36YCTnqcOLhVg1RB/WmH3qf6HmtdCSQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194498; c=relaxed/simple; bh=G5MQAkwjXu7ZUa4H1wMu9ghfVIcxJIvDSwfBOZCIFk0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DvLQXUuajXzwYAZZ8GLlWS4Ur/xvyWR4xGflKNPMx8ZNPkDuNguSWO02MvvBayi5FbIyxQs5xibXNcB7FV+IVfM99V6AKJwMgbWq5vwS4tUzEQ1lNC1ScMuOQ5Xo6ZXshWu+R2TYn06hYk/KtRTSdwgy9rZWPUApfwC9rMmURG0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=d0VKP9CN; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="d0VKP9CN" 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=Hi+jzrMT6xb/lTp/ZUXoNdBN+v14Xu6vELVXoad0c+I=; b=d0VKP9CN3z6w0GxsorO9BHkhjT GaCYxLHCxxbg0fV4lJ2gHwD3BdJpGDsh1jA9JSxUnK5eMDjhlwz4IDeVZvwtcT87hedUN/4VXZAL/ GeKPpDVkqMEZnEG3laPdsv7zNAMy1Ds0BhuzITB4gbgAEIC0RRBivdu+6sdPUYaSvgy7m8hrqRHw9 JRy3M0QDtGULwGXoBgz/thXI4KM1wjokb9KQwxvDk5hywu5kzAZALfJKReYe0TAxk5czvYniRgL7d HXGE9TG2aPvtjrgA/dO3tgCJQfvc75rOoi7ahd1AO+dLIfmaDGx3GE5w+F2QMxRonwJ/+uJ2OiZuy VoqcpuFg==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1thTw6-0000000Fva3-0YlX; Mon, 10 Feb 2025 13:34:54 +0000 From: "Matthew Wilcox (Oracle)" To: Andreas Gruenbacher Cc: "Matthew Wilcox (Oracle)" , gfs2@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: [PATCH 5/8] gfs2: Convert gfs2_jhead_pg_srch() to gfs2_jhead_folio_srch() Date: Mon, 10 Feb 2025 13:34:43 +0000 Message-ID: <20250210133448.3796209-6-willy@infradead.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250210133448.3796209-1-willy@infradead.org> References: <20250210133448.3796209-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Pass in the folio instead of the page. Add an assert that this is not a large folio as we'd need a more complex solution if we wanted to kmap() each page out of a large folio. Removes a use of folio->page. Signed-off-by: Matthew Wilcox (Oracle) --- fs/gfs2/lops.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 4123bfc16680..09e4c5915243 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -406,17 +406,16 @@ static void gfs2_end_log_read(struct bio *bio) } /** - * gfs2_jhead_pg_srch - Look for the journal head in a given page. + * gfs2_jhead_folio_srch - Look for the journal head in a given page. * @jd: The journal descriptor * @head: The journal head to start from - * @page: The page to look in + * @folio: The folio to look in * * Returns: 1 if found, 0 otherwise. */ - -static bool gfs2_jhead_pg_srch(struct gfs2_jdesc *jd, +static bool gfs2_jhead_folio_srch(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head, - struct page *page) + struct folio *folio) { struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode); struct gfs2_log_header_host lh; @@ -424,7 +423,8 @@ static bool gfs2_jhead_pg_srch(struct gfs2_jdesc *jd, unsigned int offset; bool ret = false; - kaddr = kmap_local_page(page); + VM_BUG_ON_FOLIO(folio_test_large(folio), folio); + kaddr = kmap_local_folio(folio, 0); for (offset = 0; offset < PAGE_SIZE; offset += sdp->sd_sb.sb_bsize) { if (!__get_log_header(sdp, kaddr + offset, 0, &lh)) { if (lh.lh_sequence >= head->lh_sequence) @@ -472,7 +472,7 @@ static void gfs2_jhead_process_page(struct gfs2_jdesc *jd, unsigned long index, *done = true; if (!*done) - *done = gfs2_jhead_pg_srch(jd, head, &folio->page); + *done = gfs2_jhead_folio_srch(jd, head, folio); /* filemap_get_folio() and the earlier grab_cache_page() */ folio_put_refs(folio, 2); From patchwork Mon Feb 10 13:34:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13967939 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 E0E8D22FF4E; Mon, 10 Feb 2025 13:34:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194497; cv=none; b=kp0aB9PSZtDNO8hI6vgwQ1lZsQIAaAwYGXGV3OAVzJ0vGD7Hjr8UTYhTc6YubAiOCvOhYw8F2tu/SosL19pFHdpELsbJCU0pB3OpYvLd2uAqhjNVwOVo5PSbiFXHg0AXlRlTzjLCaZaJMst5Pr2IbzH/iB/QIDYPaVi55OYScKk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194497; c=relaxed/simple; bh=x8GbB17f+XACoqPfyFB5QtZ2aYZ3oALkmXLuixabR58=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ut3+5PL5T43wNI35L/VsHIO/MKk3DGAP5BLTtzRpimxzbYtOGz8WQ9t3pg99CKrjKuAKJTPZ8frXDuEj1+RkZc8tULAJZ9ALvwf5KAUDtxGzvBPRsVsq2e+9c0qrl50RXh3KlpND+EpjmTVoM5DdQdRIflu/24aZRyY1Fo+gQJE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=EbKBdZ2f; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="EbKBdZ2f" 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=bK8uaTq/6q3eiML8MeseZqvIp5yMjC6ra65Zo4NGdn0=; b=EbKBdZ2fIPmlD5hL2vpL0LTl7u JUYQbNvy90B5V6Z8Zoau4vaoNWIN+h8UlbrCTS5qnVraKaci51mEJbyl51bEDWYImXOGvV2+AnPIH xjex9fUTZBczwtBZblSM5uHgKmH1F5rE6FIK53p2NKwV5pKoS8avS5rrsYMNBj3+hQqDDJ3PtRrjy Pgt6kHleT5FsWPwDOEkmIMEA1NWeHCipGq33WBISqc1VFECI/DqwMU2bAr14yz1eeOXOEPf2hxLaa CzEC9Zd0OB9a+Vzk+vVnePD1fz/IIjpoByH4g9fOzil7EQsPJ5GYuO1Ibk/s1VSzxJayY/Xs5SJZQ aQTxBu1A==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1thTw6-0000000Fva9-17Pe; Mon, 10 Feb 2025 13:34:54 +0000 From: "Matthew Wilcox (Oracle)" To: Andreas Gruenbacher Cc: "Matthew Wilcox (Oracle)" , gfs2@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: [PATCH 6/8] gfs2: Convert gfs2_find_jhead() to use a folio Date: Mon, 10 Feb 2025 13:34:44 +0000 Message-ID: <20250210133448.3796209-7-willy@infradead.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250210133448.3796209-1-willy@infradead.org> References: <20250210133448.3796209-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Remove a call to grab_cache_page() by using a folio throughout this function. Signed-off-by: Matthew Wilcox (Oracle) --- fs/gfs2/lops.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 09e4c5915243..30597b0f7cc3 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -514,7 +514,7 @@ int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head, struct gfs2_journal_extent *je; int sz, ret = 0; struct bio *bio = NULL; - struct page *page = NULL; + struct folio *folio = NULL; bool done = false; errseq_t since; @@ -527,9 +527,10 @@ int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head, u64 dblock = je->dblock; for (; block < je->lblock + je->blocks; block++, dblock++) { - if (!page) { - page = grab_cache_page(mapping, block >> shift); - if (!page) { + if (!folio) { + folio = filemap_grab_folio(mapping, + block >> shift); + if (!folio) { ret = -ENOMEM; done = true; goto out; @@ -541,7 +542,7 @@ int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head, sector_t sector = dblock << sdp->sd_fsb2bb_shift; if (bio_end_sector(bio) == sector) { - sz = bio_add_page(bio, page, bsize, off); + sz = bio_add_folio(bio, folio, bsize, off); if (sz == bsize) goto block_added; } @@ -562,12 +563,12 @@ int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head, bio = gfs2_log_alloc_bio(sdp, dblock, gfs2_end_log_read); bio->bi_opf = REQ_OP_READ; add_block_to_new_bio: - sz = bio_add_page(bio, page, bsize, off); + sz = bio_add_folio(bio, folio, bsize, off); BUG_ON(sz != bsize); block_added: off += bsize; - if (off == PAGE_SIZE) - page = NULL; + if (off == folio_size(folio)) + folio = NULL; if (blocks_submitted <= blocks_read + max_blocks) { /* Keep at least one bio in flight */ continue; From patchwork Mon Feb 10 13:34:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13967940 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 55353230D18; Mon, 10 Feb 2025 13:34:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194498; cv=none; b=L1v7BlZPzPF91quDQ7OxBuOBBJXDnZZtWILMb4QM/1pD6KZAY0PYXx8goDdcRMFBm2JPwj2skAFcgw3Qo6L5Itcps1aoRsX6ATljQlxO1x8f78mKkF8nU00XiUa+Sa2kpqJl1x+bPak+SfV6ZEvCHuSHeUE1IF13SwQj7VUHE4g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194498; c=relaxed/simple; bh=UU7syauqzVZwhsnjUqsoUUOJI9XblAScW2ZLMVEjF/U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SKnLFjrmY/l4rcn7qnFsoei6seDN7M8irJpRnKx2nE7/k675FsJsfM+dJ3ifRSMoCT40pU9NyjdFoYDYB7mG70UYFvS0yFcDNvKNNvX/U9UZMpPrEqdeqxwOCdC68yxI3Q9wnufiW8rocWanSQSjPi5R/uiAJZYXdoKohUlqKZk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=t5S7TjhD; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="t5S7TjhD" 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=9Am55nrwyi7Dlm+nrNHLjnahw8j8cNtEuVddBLL3rhI=; b=t5S7TjhDfbXNpdL2zMZGTdS8/N DH/5gjDU/uq1y4hZsJ1OsLRNSKJLVEpbzejezbXb5kCzYYym4SIG6r6GbLA842vf/yIBBVn55MAfT jkeQA73/n/fA2ESO8X1K4eYZtGF1ZVLyYtxld4HXIbbX4dGAOzU6pALjZT4ez2q8uPtrHkK0lg3Ty iXguy8zBt458BtRDqqgxBIPMKvbPEEQGTDI7tWASmUOE5tRYnmnwFVrPfLM5VZHB+QgAwgUqQ6U6d IG1ksVAVVo1rfbT7m5mmmC+bRxlTCQGZz8zQ/MqfF6LqM+2HBDmI8ogzGPLQ1uwVkI86wm6pVMW54 Cxj6BTZg==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1thTw6-0000000FvaF-1e3m; Mon, 10 Feb 2025 13:34:54 +0000 From: "Matthew Wilcox (Oracle)" To: Andreas Gruenbacher Cc: "Matthew Wilcox (Oracle)" , gfs2@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: [PATCH 7/8] gfs2: Convert gfs2_end_log_write_bh() to work on a folio Date: Mon, 10 Feb 2025 13:34:45 +0000 Message-ID: <20250210133448.3796209-8-willy@infradead.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250210133448.3796209-1-willy@infradead.org> References: <20250210133448.3796209-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 gfs2_end_log_write() has to handle bios which consist of both pages which belong to folios and pages which were allocated from a mempool and do not belong to a folio. It would be cleaner to have separate endio handlers which handle each type, but it's not clear to me whether that's even possible. This patch is slightly forward-looking in that page_folio() cannot currently return NULL, but it will return NULL in the future for pages which do not belong to a folio. This was the last user of page_has_buffers(), so remove it. Signed-off-by: Matthew Wilcox (Oracle) --- fs/gfs2/lops.c | 28 ++++++++++++++-------------- include/linux/buffer_head.h | 1 - 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 30597b0f7cc3..8b46bd01a448 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -157,7 +157,9 @@ u64 gfs2_log_bmap(struct gfs2_jdesc *jd, unsigned int lblock) /** * gfs2_end_log_write_bh - end log write of pagecache data with buffers * @sdp: The superblock - * @bvec: The bio_vec + * @folio: The folio + * @offset: The first byte within the folio that completed + * @size: The number of bytes that completed * @error: The i/o status * * This finds the relevant buffers and unlocks them and sets the @@ -166,17 +168,13 @@ u64 gfs2_log_bmap(struct gfs2_jdesc *jd, unsigned int lblock) * that is pinned in the pagecache. */ -static void gfs2_end_log_write_bh(struct gfs2_sbd *sdp, - struct bio_vec *bvec, - blk_status_t error) +static void gfs2_end_log_write_bh(struct gfs2_sbd *sdp, struct folio *folio, + size_t offset, size_t size, blk_status_t error) { struct buffer_head *bh, *next; - struct page *page = bvec->bv_page; - unsigned size; - bh = page_buffers(page); - size = bvec->bv_len; - while (bh_offset(bh) < bvec->bv_offset) + bh = folio_buffers(folio); + while (bh_offset(bh) < offset) bh = bh->b_this_page; do { if (error) @@ -186,7 +184,7 @@ static void gfs2_end_log_write_bh(struct gfs2_sbd *sdp, size -= bh->b_size; brelse(bh); bh = next; - } while(bh && size); + } while (bh && size); } /** @@ -203,7 +201,6 @@ static void gfs2_end_log_write(struct bio *bio) { struct gfs2_sbd *sdp = bio->bi_private; struct bio_vec *bvec; - struct page *page; struct bvec_iter_all iter_all; if (bio->bi_status) { @@ -217,9 +214,12 @@ static void gfs2_end_log_write(struct bio *bio) } bio_for_each_segment_all(bvec, bio, iter_all) { - page = bvec->bv_page; - if (page_has_buffers(page)) - gfs2_end_log_write_bh(sdp, bvec, bio->bi_status); + struct page *page = bvec->bv_page; + struct folio *folio = page_folio(page); + + if (folio && folio_buffers(folio)) + gfs2_end_log_write_bh(sdp, folio, bvec->bv_offset, + bvec->bv_len, bio->bi_status); else mempool_free(page, gfs2_page_pool); } diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 932139c5d46f..fab70b26e131 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -182,7 +182,6 @@ static inline unsigned long bh_offset(const struct buffer_head *bh) BUG_ON(!PagePrivate(page)); \ ((struct buffer_head *)page_private(page)); \ }) -#define page_has_buffers(page) PagePrivate(page) #define folio_buffers(folio) folio_get_private(folio) void buffer_check_dirty_writeback(struct folio *folio, From patchwork Mon Feb 10 13:34:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13967938 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 553CD230D30; Mon, 10 Feb 2025 13:34:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194497; cv=none; b=payIVkv7ve+ixiplWX6ctejbLb+hXU0k/l2xHxRbTza2FwfDESN1LdocbIkY6xRa0VmpnXmIMQeeQrxOwTRbm5xZK7oeP3P4NdfNX3yXqxe/Qc5qm9BPlddFEdbQw44c5I5Z7yjAxouHBwvaojXZU5Jws6nEQmy4lkDxQmwkX/Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739194497; c=relaxed/simple; bh=jytbP/7CpqddLcMVzufHIC4HolRZQ1p9IdqKYMkBl10=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JGEBAoCgpRnELbpFX359gkFUIZfOTQjLKEwk8NXMYJsO5UqAr1D/COnqa+aCgSOoK/S4YdQ3GCFX2UkyqybRLZgn5PIYLYarVQAy6BEYFjJd9tYP0zltDm6KzW88OQZ0XuvKg51X5+4yb0X964b40JVsBKMaCiASwLB8N5TzaqA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=FH+pl9d0; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="FH+pl9d0" 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=3MHZxmUQgMb6Ftxk2klgrN+WeAlCYx13en5pr+i0su4=; b=FH+pl9d0O8QJOPsBGen7/isv4j aZaaVytGw1zqa0OWz5EO/diTaUZcbLW8ONQ+if0oXnE32ESgpePR6ehAk6SZA95WuqWaXT0JuUoKK FwMajDkYyvoaE7rp5cO/qG8HZblweOeDYzTrHwPsi2+9kAOMBu8AZqMHwLc/coDfUoQ0p8/QGckBM snhfoZY9F/QW3fqmQ/Jkyl/4z30O/D/5venoIjGKMxq1Vs7RiNy1HiQ+VP2B/joDP4jXc1iH0YViu 5yoUv9BeOjlsFTUBOAUX/ze+p0pjNOtbimW3RvIwkuPUryzktdljToywoJboeeoM+GCyOpxZAEDN7 IpzPp8Lw==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1thTw6-0000000FvaL-2BR3; Mon, 10 Feb 2025 13:34:54 +0000 From: "Matthew Wilcox (Oracle)" To: Andreas Gruenbacher Cc: "Matthew Wilcox (Oracle)" , gfs2@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: [PATCH 8/8] gfs2: Convert gfs2_meta_read_endio() to use a folio Date: Mon, 10 Feb 2025 13:34:46 +0000 Message-ID: <20250210133448.3796209-9-willy@infradead.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250210133448.3796209-1-willy@infradead.org> References: <20250210133448.3796209-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Switch from bio_for_each_segment_all() to bio_for_each_folio_all() which removes a call to page_buffers(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/gfs2/meta_io.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 66db506a5f7f..198cc7056637 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c @@ -198,15 +198,14 @@ struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno) static void gfs2_meta_read_endio(struct bio *bio) { - struct bio_vec *bvec; - struct bvec_iter_all iter_all; + struct folio_iter fi; - bio_for_each_segment_all(bvec, bio, iter_all) { - struct page *page = bvec->bv_page; - struct buffer_head *bh = page_buffers(page); - unsigned int len = bvec->bv_len; + bio_for_each_folio_all(fi, bio) { + struct folio *folio = fi.folio; + struct buffer_head *bh = folio_buffers(folio); + size_t len = fi.length; - while (bh_offset(bh) < bvec->bv_offset) + while (bh_offset(bh) < fi.offset) bh = bh->b_this_page; do { struct buffer_head *next = bh->b_this_page;