From patchwork Thu Feb 13 18:37:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13973912 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 AD6EF28A2D5; Thu, 13 Feb 2025 18:37:37 +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=1739471860; cv=none; b=qP4gU8gxCLvfUO8KEHRTBQDIdFi9oqQADtjoOm1ID9B+KpB4CFf+nTbB7wVIx6dE2vbmOJE31YnfQTRiBmf8i80zyKTbeUNeDUh8UWKvkrMUcaGKMdVSx0XrT1bTsVen2Slf2eZ51vFQGn/VXw+tQ68P0374/1VS0geEhRjqwGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739471860; c=relaxed/simple; bh=DqXAEPJ8ErZM7cycOGoIq9iksF2oj/fJ/1pz322nh4M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lMHV/TNfUQUhMdHVTX5XoMBpLBRGnDIPxgUXFH704Q7oW47F0p864lZFMDcMsM8JUPJF4hhbwEYtgDlV24AW9lwXcFBihX2Y5bgvDNE08J0kOmBgDEQeBl5plfbE3wI0h3RdWJJSK4TkMNBUy4MVIFeaf3otYd6GZPXmmzehn+g= 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=gAgLO/EM; 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="gAgLO/EM" 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: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=bnvyc/NuV7z35ssyB2tkxyuod9W+bL9XL0cWnxJfv54=; b=gAgLO/EMNQwm3DJZlEMM0g0Saf zrEL4uOZLzSSxjZknHN7kch/adUm2KUn1zGlqtyxbJvqUgesnL7deYaO2NfKBROnAujUBhCeywCTt bGPgtmZGEPyOhpCcrxbKDJ609IxJnu/9dnRFv64qkcffNVEDZel8aOX3pL0n5c99proWpJq21kP1u 6i+mbyqj9jf8jFia7TU7R7IKwXWRCn3D+7pGNtyPr0vXDrzfJDwuohFNSBEkSK086J3Tuxpbshp9E r8pSHk57Gx3DGLTrGaLUqXA7DiRK0BZPSdeTdCmyJ5KKqs1huJEsW4aWe0utHSfwgxENKx5BSdyHD 2pKK7B9w==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tie5d-00000008z7e-3Ym0; Thu, 13 Feb 2025 18:37:33 +0000 From: "Matthew Wilcox (Oracle)" To: Joseph Qi Cc: "Matthew Wilcox (Oracle)" , Mark Tinguely , ocfs2-devel@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: [PATCH 1/2] ocfs2: Use b_folio in ocfs2_symlink_get_block() Date: Thu, 13 Feb 2025 18:37:27 +0000 Message-ID: <20250213183730.2141556-1-willy@infradead.org> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: ocfs2-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 We are preparing to remove bh->b_page. While modifying this function, switch from kmap_atomic to kmap_local, remove the test for kmap_local failing (it cannot), and reflow the conditional to match kernel coding style. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ocfs2/aops.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 5bbeb6fbb1ac..4790e2ba1671 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -91,17 +91,12 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock, * could've happened. Since we've got a reference on * the bh, even if it commits while we're doing the * copy, the data is still good. */ - if (buffer_jbd(buffer_cache_bh) - && ocfs2_inode_is_new(inode)) { - kaddr = kmap_atomic(bh_result->b_page); - if (!kaddr) { - mlog(ML_ERROR, "couldn't kmap!\n"); - goto bail; - } - memcpy(kaddr + (bh_result->b_size * iblock), - buffer_cache_bh->b_data, - bh_result->b_size); - kunmap_atomic(kaddr); + if (buffer_jbd(buffer_cache_bh) && ocfs2_inode_is_new(inode)) { + kaddr = kmap_local_folio(bh_result->b_folio, + bh_result->b_size * iblock); + memcpy(kaddr, buffer_cache_bh->b_data, + bh_result->b_size); + kunmap_local(kaddr); set_buffer_uptodate(bh_result); } brelse(buffer_cache_bh); From patchwork Thu Feb 13 18:37:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13973913 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 CC56E241691; Thu, 13 Feb 2025 18:37:40 +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=1739471863; cv=none; b=NByIe1v67lrB/OZTa3zMeyqqKBF78F/B82ySDMBeVENfIETqzh5fEmRma9G//JWkUmPX4layWXou4w0hX6z8nJRdWZHDE0RMk8qfZ7IvGzGRUDD6DQTlTf2caO+pFXqfreYGxEIlYXHSgAJ04Jg45NH43x7bsg1yUCH5nODBEfc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739471863; c=relaxed/simple; bh=yBr5n64/ykMjm6l699ntGDgQuyR6cT5PkvcbbqbzmQo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=vC0lbsUbaHyMeI2E7XxgzK6xQJvDAM9mr0oxsQ3vSpXxG33psnjbAYGrUUgtqEg2RvN7kWWOYn83SgqkU9FXhUYnLmS3jEC5ktfzwHT82BPWdptt4RHnHi7CRsjHE4Kfse4p2JiOTKvZXrdDrbu7zkgX4aql9J30DNJHsq/UIpk= 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=fkvN5jxq; 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="fkvN5jxq" 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=p9WBGnIqtnFeSuvIK0AsG0uMMrdub4bF1vsPcqX4HAQ=; b=fkvN5jxq5sMCEWgTFylh/NIM5m nN31gfLpAzX2HoHocMzez1CE9No45SC0wV5z7A2uq3wzylvtMxGteB9/cnmUfU34R1hXTF457jpWT bXNaDvnOnzxpg1etS0Eyp/HO9e7IEIO24PCjD6L5PRItwnUmsonpUUO8qB2fq4o9VzGV2tURCre+Y nYsPV4lYgCcvWjG8i5MIomrviU8ux+nHhJGVsyUgSo85yMKKBW06MHMEKWK7OjL1uolFCNtnxYZU7 3yoenr5ZW7YSfAkZPs0A3OOKkf/jdT2d1igXBBPDWlw9Wbq8qIiY740lIPKIgO+bKy0UxOkHea+EI D6Y4K2IQ==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tie5f-00000008z7m-0MWa; Thu, 13 Feb 2025 18:37:35 +0000 From: "Matthew Wilcox (Oracle)" To: Joseph Qi Cc: "Matthew Wilcox (Oracle)" , Mark Tinguely , ocfs2-devel@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: [PATCH 2/2] ocfs2: Remove reference to bh->b_page Date: Thu, 13 Feb 2025 18:37:28 +0000 Message-ID: <20250213183730.2141556-2-willy@infradead.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250213183730.2141556-1-willy@infradead.org> References: <20250213183730.2141556-1-willy@infradead.org> Precedence: bulk X-Mailing-List: ocfs2-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Buffer heads are attached to folios, not to pages. Also flush_dcache_page() is now deprecated in favour of flush_dcache_folio(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/ocfs2/quota_global.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index 15d9acd456ec..e85b1ccf81be 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c @@ -273,7 +273,7 @@ ssize_t ocfs2_quota_write(struct super_block *sb, int type, if (new) memset(bh->b_data, 0, sb->s_blocksize); memcpy(bh->b_data + offset, data, len); - flush_dcache_page(bh->b_page); + flush_dcache_folio(bh->b_folio); set_buffer_uptodate(bh); unlock_buffer(bh); ocfs2_set_buffer_uptodate(INODE_CACHE(gqinode), bh);