From patchwork Sat Oct 5 18:02:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13823393 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 83292158DC2 for ; Sat, 5 Oct 2024 18:02:27 +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=1728151349; cv=none; b=OGL2zykpHMOXtcOZ05HV3hHndCEZos7p631lIYH5e/DOXd8E8FoAKgT4cCKGZU4pV1K4xPy0EZ1XC+pRvUs6JSrdkBr1dR4yERRDArx76KPgbXKZnJlp+2hoAxvxe/rbzB0/jC+6ykxPxhukL+GV4fQzJfgLgyUeKgqpv/adq1E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728151349; c=relaxed/simple; bh=PlWCxq6U6xjwTX2JCgCekdY46o3eRorVdLgWcknPces=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H0jFO1THTx66MD8YQVpVoGu2PUabCLZPgPye0rGk+dIq0qJMoUxmf24N/LKL87faObwpa8Ou7sLYeOA6diJQDi6JF0JkA7ZegsSRoXFe+YuiNgcIzjWm4POeRX5e+B3RAV6AGIk0uEIm+QmseyB7mMqq406trr/hkp5OpbtdTKU= 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=WS37ciV0; 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="WS37ciV0" 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=fPKh53M83a7w8zQJie8gJVgmbMJi4dZBW1SxuYASWY0=; b=WS37ciV0iJQuQAstvvx3CbHlXR zwKtP+y1jWdWozkusTUk31wll0yLG+u09Hld7L013t8xBW13BqcrSbxG6luTL7Ouk7uifXb+1OIzD A0KBgTdp6h5lB/h7i3qS1gNajiOTcSVIhfY9g2zGNhmgdJemhdStWSEaW6NBTGt1D6XDGIlwr+f2U +TTYKw1ySreONDacKeGutlWDaMsFqqneCRkC1Z0d9KBJixYHMn3FR9Wg7B2L4bqmDiQuPaZ5Tsrsn FE3Nd6EIOdfpTL8yDCPdzz7ciYmSebNgyTB7ZvH8mDWl5RUsHfLxPHlROsrQ8JQXVbInEfVeEvwH/ p8VvLL2A==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1sx96f-0000000DLl8-24NF; Sat, 05 Oct 2024 18:02:17 +0000 From: "Matthew Wilcox (Oracle)" To: Alexander Viro Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org Subject: [PATCH 1/5] ufs: Convert ufs_inode_getblock() to take a folio Date: Sat, 5 Oct 2024 19:02:04 +0100 Message-ID: <20241005180214.3181728-2-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241005180214.3181728-1-willy@infradead.org> References: <20241005180214.3181728-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 bh->b_folio instead of bh->b_page. They're in a union, so no code change expected. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ufs/inode.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index 5331ae7ebf3e..aad3bdd4422f 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c @@ -329,12 +329,11 @@ ufs_inode_getfrag(struct inode *inode, unsigned index, * (block will hold this fragment and also uspi->s_fpb-1) * @err: see ufs_inode_getfrag() * @new: see ufs_inode_getfrag() - * @locked_page: see ufs_inode_getfrag() + * @locked_folio: see ufs_inode_getfrag() */ -static u64 -ufs_inode_getblock(struct inode *inode, u64 ind_block, - unsigned index, sector_t new_fragment, int *err, - int *new, struct page *locked_page) +static u64 ufs_inode_getblock(struct inode *inode, u64 ind_block, + unsigned index, sector_t new_fragment, int *err, + int *new, struct folio *locked_folio) { struct super_block *sb = inode->i_sb; struct ufs_sb_private_info *uspi = UFS_SB(sb)->s_uspi; @@ -369,7 +368,7 @@ ufs_inode_getblock(struct inode *inode, u64 ind_block, else goal = bh->b_blocknr + uspi->s_fpb; tmp = ufs_new_fragments(inode, p, ufs_blknum(new_fragment), goal, - uspi->s_fpb, err, locked_page); + uspi->s_fpb, err, &locked_folio->page); if (!tmp) goto out; @@ -450,7 +449,7 @@ static int ufs_getfrag_block(struct inode *inode, sector_t fragment, struct buff phys64 = ufs_inode_getblock(inode, phys64, offsets[i], fragment, &err, NULL, NULL); phys64 = ufs_inode_getblock(inode, phys64, offsets[depth - 1], - fragment, &err, &new, bh_result->b_page); + fragment, &err, &new, bh_result->b_folio); } out: if (phys64) { From patchwork Sat Oct 5 18:02:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13823390 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 B89DE4503C for ; Sat, 5 Oct 2024 18:02:25 +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=1728151347; cv=none; b=J3/zRjpWAFlsTtwW0/RHGZNvzq4LmcPJEKs5Aw+gOVG4oEj+yx075OO8FaXM32oemLvB3F+2exZW8EcfzU+inJJll2ctkGzwX2pmbkkCJM7GLDchxaLyIY6UGTcBlbEETZU+ZFfIiKbAYPRNGhfaJThxvKuVMHC8pyGBbnChxEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728151347; c=relaxed/simple; bh=Tu7UwD9PNYOt8IAlg5OZCWlTZonRsTphFhlVorigUFY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E6TF0ZLUaz23IC42xA+WmsZTEYc5HKRVemYtHDrkwnuNIXVvO8ysrHmsP2C+5Lx5jb/ruVPnvdE08OWaRVFPLHmQvVH96gfjaWekijTe3t9WEJU18q3OHllEBq5QWz9NwW8s0FcMZy+0j3XKvqay1xJ6yLoW07yH5kA8LzSpiWY= 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=uTkkLliv; 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="uTkkLliv" 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=fCirP0wIga6EITsKYr6mGFcZ2l1MjEpoNINKdhUakD4=; b=uTkkLlivVipkYHGNqb6WGR5Fh+ xWR95nZo3ZQfJgPiSFeX68/Kg9ZAhvL3klTAboh6ABwuw6nHpwQxVEaN5JEAwiR5W+XozlkeMB4HE jkh4WUWQqWeSLkWXJuRKiqpkgBI6lZPQMhYIAYDGGGKE2pmodpWeKlUk5DVMRJKbL7atHGgb5Now5 aoVxSFqH91DPU4LBCHsn8oLafSk/5XVJMEWOBTg6fKAVDLv/EP49TAMUzIQ4RMyCKiYXbCxk5Ck2Y xFuiM3AFe26kaYgg8hIHFQdGBOMdx7ue0BYHdnH4y9Fp5epji4zWtZfLxaEhXfXgCK3H4el86uK0O zDbCbiVQ==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1sx96f-0000000DLlH-2Tb7; Sat, 05 Oct 2024 18:02:17 +0000 From: "Matthew Wilcox (Oracle)" To: Alexander Viro Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org Subject: [PATCH 2/5] ufs: Convert ufs_extend_tail() to take a folio Date: Sat, 5 Oct 2024 19:02:05 +0100 Message-ID: <20241005180214.3181728-3-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241005180214.3181728-1-willy@infradead.org> References: <20241005180214.3181728-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 bh->b_folio instead of bh->b_page. They're in a union, so no code change expected. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ufs/inode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index aad3bdd4422f..937d3b787d1e 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c @@ -220,7 +220,7 @@ static u64 ufs_frag_map(struct inode *inode, unsigned offsets[4], int depth) */ static bool ufs_extend_tail(struct inode *inode, u64 writes_to, - int *err, struct page *locked_page) + int *err, struct folio *locked_folio) { struct ufs_inode_info *ufsi = UFS_I(inode); struct super_block *sb = inode->i_sb; @@ -239,7 +239,7 @@ ufs_extend_tail(struct inode *inode, u64 writes_to, p = ufs_get_direct_data_ptr(uspi, ufsi, block); tmp = ufs_new_fragments(inode, p, lastfrag, ufs_data_ptr_to_cpu(sb, p), new_size - (lastfrag & uspi->s_fpbmask), err, - locked_page); + &locked_folio->page); return tmp != 0; } @@ -433,7 +433,7 @@ static int ufs_getfrag_block(struct inode *inode, sector_t fragment, struct buff unsigned tailfrags = lastfrag & uspi->s_fpbmask; if (tailfrags && fragment >= lastfrag) { if (!ufs_extend_tail(inode, fragment, - &err, bh_result->b_page)) + &err, bh_result->b_folio)) goto out; } } From patchwork Sat Oct 5 18:02:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13823391 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 5A97B25777 for ; Sat, 5 Oct 2024 18:02:25 +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=1728151347; cv=none; b=E2Gg3waJjgKW3Vlm11vB363bGoLMZOkPaY9LWdgawgZtfVevEP3Lte8Rj82yGb/HT7Xmc66SRK3fytD0UhbAs+GO1p5wMGkVQAnVPUGRES0loa9jdFodnEuZq58abvAA1A38QRWZjLkhYp0P5y6eyawUilS9+tuxmveaEa3SM6A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728151347; c=relaxed/simple; bh=xr3WTDE8Jzv9iHD3GzuSA8kDc08NZjDpgnfQplLZH8w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L9fhcJIrNPW88QY36oLNDxS7CVJl6tEOzgs2U/+m712JYtXAZVOAW+aPi+PgCITAYPalXS6/nXtr+QLzOULjSr2vlvf4OCMnNV6kAd0pu4Tbjp+y9tJi9yr2dSre6uqNTKRzDenYT1p3WEaeY6jP+BCWIr1DXaOtzN97Ar3FqYY= 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=DQ6Xd5ZJ; 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="DQ6Xd5ZJ" 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=4BdRuetzXnT7AY6jjsMZNuMTqbIN3zM+26SdswZP6vY=; b=DQ6Xd5ZJYJ8gXjkboid199Sf32 OcNXvYZ+BL96sbcdCJEfVV6AMb30VNKpPVk+cBO7JOSKGSQS+0XrHqeJAI5dZskKJf7N/myysa4dx 3Xe00LQTJqoiYFwuiF/bmLx9fSWgKTIpHQ6dzQVk0mEQGXWXqSHVmn8wYWrwt/47Nxyg2Kk4ktJf8 gZ1C2t8hu3XczKGhz9uij48JM/xJDywR0ADMfl15stNDQiawLlWnbxQfuS3XbYvqOtMpRJepqidDA JyAVlH/dZjTJgP81cmylPYyutbtpOVCoc6K+JSJXpBN3pQ/vDqxsrug4wrHu0jVBXujiHSfwSPdxt DAd25OkQ==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1sx96f-0000000DLlQ-34sx; Sat, 05 Oct 2024 18:02:17 +0000 From: "Matthew Wilcox (Oracle)" To: Alexander Viro Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org Subject: [PATCH 3/5] ufs: Convert ufs_inode_getfrag() to take a folio Date: Sat, 5 Oct 2024 19:02:06 +0100 Message-ID: <20241005180214.3181728-4-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241005180214.3181728-1-willy@infradead.org> References: <20241005180214.3181728-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 bh->b_folio instead of bh->b_page. They're in a union, so no code change expected. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ufs/inode.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index 937d3b787d1e..a2be1bd301ee 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c @@ -252,10 +252,9 @@ ufs_extend_tail(struct inode *inode, u64 writes_to, * @new: we set it if we allocate new block * @locked_page: for ufs_new_fragments() */ -static u64 -ufs_inode_getfrag(struct inode *inode, unsigned index, +static u64 ufs_inode_getfrag(struct inode *inode, unsigned index, sector_t new_fragment, int *err, - int *new, struct page *locked_page) + int *new, struct folio *locked_folio) { struct ufs_inode_info *ufsi = UFS_I(inode); struct super_block *sb = inode->i_sb; @@ -288,7 +287,7 @@ ufs_inode_getfrag(struct inode *inode, unsigned index, goal += uspi->s_fpb; } tmp = ufs_new_fragments(inode, p, ufs_blknum(new_fragment), - goal, nfrags, err, locked_page); + goal, nfrags, err, &locked_folio->page); if (!tmp) { *err = -ENOSPC; @@ -440,7 +439,7 @@ static int ufs_getfrag_block(struct inode *inode, sector_t fragment, struct buff if (depth == 1) { phys64 = ufs_inode_getfrag(inode, offsets[0], fragment, - &err, &new, bh_result->b_page); + &err, &new, bh_result->b_folio); } else { int i; phys64 = ufs_inode_getfrag(inode, offsets[0], fragment, From patchwork Sat Oct 5 18:02:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13823389 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 5A9AC40C15 for ; Sat, 5 Oct 2024 18:02:25 +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=1728151346; cv=none; b=gPGTig30Oh/FeKV49c8NXU1LIwFFzD4cPK6Db8I3R4/LSwMBaC214jR9uIvzcawaOa66+Tp0G4GQ5u9cxV6a3/4zpTneejA8tppMVQ3MnZlJMeD08V66TjvG0ju2oDIdhuNImTG421AGf20/hXUAhkRAluJv2zhOxwk6m9K3kQg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728151346; c=relaxed/simple; bh=LdyGAAj4knWMDajjRvuu0pnE4ZfGYgw6Af+zh25NIPY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aV6Kt3eUJr9eVuLrdUt8DcFt3z7c35G8amVr3MK+GlEzm1WN6RQQ5dShY4SO4ELFH32qiWcBlPvHrXWCG11BwpyDl2Qs9eqiM9TJuS8BA4gfNQKleO1wBihxhxEAEUiQm9J4945X9g87ZIzqjwkfPHiEpIs5QdP6yiWo3pG0Heg= 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=Yls1V4w9; 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="Yls1V4w9" 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=bFsXyN0pe8TO0FfymeIVL5FGxEwmd7OwuICgPpBSdMM=; b=Yls1V4w9MTVdkeEHFjNghe+SFQ O/2k8uapSMBLw9Pfx9Ye1Yg9gGHtk9ImQ2IGO8gyhKwzYgXxQVvfqLR8DWWlWbRltQKiKe4ySVaty ZSBmjdiMEnQaecvQOv3ZuBK63ruV9n1ysvAA8Q5hfyQjuk58xh9yuvz9XZSm/0CcB66AX3dh4cTLr c0s4a9p3+uSXQHq8xqOQR+v+0DWDRVqcD/+kV+Kz0T1z7s98ZFp09WSfVxLCCvj3rgoQ9JnAsnKCD YiuZ7rFOElPKce/eDOq3bMKnSxAWqMPwALFYKexps1o3ox7CFHtnLLoha4Wl8UXRakUIbh2PG1Tfp JZwUU38Q==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1sx96f-0000000DLlW-3dW5; Sat, 05 Oct 2024 18:02:17 +0000 From: "Matthew Wilcox (Oracle)" To: Alexander Viro Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org Subject: [PATCH 4/5] ufs: Pass a folio to ufs_new_fragments() Date: Sat, 5 Oct 2024 19:02:07 +0100 Message-ID: <20241005180214.3181728-5-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241005180214.3181728-1-willy@infradead.org> References: <20241005180214.3181728-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 All callers now have a folio, pass it to ufs_new_fragments() instead of converting back to a page. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ufs/balloc.c | 10 +++++----- fs/ufs/inode.c | 8 ++++---- fs/ufs/ufs.h | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c index 53c11be2b2c1..2abe13d07f85 100644 --- a/fs/ufs/balloc.c +++ b/fs/ufs/balloc.c @@ -337,7 +337,7 @@ static void ufs_clear_frags(struct inode *inode, sector_t beg, unsigned int n, u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment, u64 goal, unsigned count, int *err, - struct page *locked_page) + struct folio *locked_folio) { struct super_block * sb; struct ufs_sb_private_info * uspi; @@ -417,7 +417,7 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment, result = ufs_alloc_fragments (inode, cgno, goal, count, err); if (result) { ufs_clear_frags(inode, result + oldcount, - newcount - oldcount, locked_page != NULL); + newcount - oldcount, locked_folio != NULL); *err = 0; write_seqlock(&UFS_I(inode)->meta_lock); ufs_cpu_to_data_ptr(sb, p, result); @@ -441,7 +441,7 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment, fragment + count); read_sequnlock_excl(&UFS_I(inode)->meta_lock); ufs_clear_frags(inode, result + oldcount, newcount - oldcount, - locked_page != NULL); + locked_folio != NULL); mutex_unlock(&UFS_SB(sb)->s_lock); UFSD("EXIT, result %llu\n", (unsigned long long)result); return result; @@ -462,11 +462,11 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment, result = ufs_alloc_fragments (inode, cgno, goal, request, err); if (result) { ufs_clear_frags(inode, result + oldcount, newcount - oldcount, - locked_page != NULL); + locked_folio != NULL); mutex_unlock(&UFS_SB(sb)->s_lock); ufs_change_blocknr(inode, fragment - oldcount, oldcount, uspi->s_sbbase + tmp, - uspi->s_sbbase + result, locked_page); + uspi->s_sbbase + result, &locked_folio->page); *err = 0; write_seqlock(&UFS_I(inode)->meta_lock); ufs_cpu_to_data_ptr(sb, p, result); diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index a2be1bd301ee..b9359fd95d00 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c @@ -239,7 +239,7 @@ ufs_extend_tail(struct inode *inode, u64 writes_to, p = ufs_get_direct_data_ptr(uspi, ufsi, block); tmp = ufs_new_fragments(inode, p, lastfrag, ufs_data_ptr_to_cpu(sb, p), new_size - (lastfrag & uspi->s_fpbmask), err, - &locked_folio->page); + locked_folio); return tmp != 0; } @@ -250,7 +250,7 @@ ufs_extend_tail(struct inode *inode, u64 writes_to, * @new_fragment: number of new allocated fragment(s) * @err: we set it if something wrong * @new: we set it if we allocate new block - * @locked_page: for ufs_new_fragments() + * @locked_folio: for ufs_new_fragments() */ static u64 ufs_inode_getfrag(struct inode *inode, unsigned index, sector_t new_fragment, int *err, @@ -287,7 +287,7 @@ static u64 ufs_inode_getfrag(struct inode *inode, unsigned index, goal += uspi->s_fpb; } tmp = ufs_new_fragments(inode, p, ufs_blknum(new_fragment), - goal, nfrags, err, &locked_folio->page); + goal, nfrags, err, locked_folio); if (!tmp) { *err = -ENOSPC; @@ -367,7 +367,7 @@ static u64 ufs_inode_getblock(struct inode *inode, u64 ind_block, else goal = bh->b_blocknr + uspi->s_fpb; tmp = ufs_new_fragments(inode, p, ufs_blknum(new_fragment), goal, - uspi->s_fpb, err, &locked_folio->page); + uspi->s_fpb, err, locked_folio); if (!tmp) goto out; diff --git a/fs/ufs/ufs.h b/fs/ufs/ufs.h index a2c762cb65a0..9b462c62511f 100644 --- a/fs/ufs/ufs.h +++ b/fs/ufs/ufs.h @@ -88,10 +88,10 @@ struct ufs_inode_info { #endif /* balloc.c */ -extern void ufs_free_fragments (struct inode *, u64, unsigned); -extern void ufs_free_blocks (struct inode *, u64, unsigned); -extern u64 ufs_new_fragments(struct inode *, void *, u64, u64, - unsigned, int *, struct page *); +void ufs_free_fragments (struct inode *, u64 fragment, unsigned count); +void ufs_free_blocks (struct inode *, u64 fragment, unsigned count); +u64 ufs_new_fragments(struct inode *, void *, u64 fragment, u64 goal, + unsigned count, int *err, struct folio *); /* cylinder.c */ extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); From patchwork Sat Oct 5 18:02:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13823392 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 5A92FA31 for ; Sat, 5 Oct 2024 18:02:25 +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=1728151348; cv=none; b=O8QMsgusWm2wMRSbZuHLnVzc6ZJp7FRYrUyWXK9N29hwD+TUZYdTdhxBDpiC9aad4EUyBLxHamSCWmqnPumEHQlZsL/Qraq7+W6OLCNmfu68ZZCR4wyGXePF4xcqGXa0JK9e6cBkwXxsToylCpmElf30sSARCcnUg7+gTR6+MCY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728151348; c=relaxed/simple; bh=ZwlmAZjrMhJhmWdLSlfce+9A5uWV1PsoltGGEEexdIc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CShYcXGB6aM/9tKyglqjYGYJXpNhOyzOutcsLUCMsgVbkG8sn58T7UExJtgvw+/Oc8UwD8i0795rdZx++8j1ro1HsiNlScTuNmITlAmvBy8m2HaHK6bJU4yjS2Tie5ea6KOBPt29EB8ajhMPC0m4LUc9c6h0sLj3ulwTZHSkuyI= 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=W4Jjw6YF; 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="W4Jjw6YF" 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=Rg6wGH/NhIcH6md67KX9ylJkRcAUN2LArvAx9tPJs94=; b=W4Jjw6YFW3hD8GeLMruxziwmFG pu5ZePKaJMxF3cMZw+g9IYUeR7/CIWoFapGfXjVygsk3KuSdBtNsjd9md4jb/TIEc52Dwq3XZ8cpe qubtuk2glWa7vS0eCos4/Cj8gi1kseK1jATKnqYspbMICsAHNpvhznVO9zoWYo5UqC7QkHVTNo/+G ZRNxvRU5bbc2PKHGogECjCDX6ncTLlDAiW7zYVNmJ/pWbIkfQP37zDmlETbarEGr6L1srWvbr01ef PKfAS2B7zDy4/s1R3KsxFweISvNJKGGqF3/Zex8hkZ7YQrYj6jtX5k0uB/p8dXIZEfS4dM0PqD3El oPk2QfyQ==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1sx96g-0000000DLlc-00iA; Sat, 05 Oct 2024 18:02:18 +0000 From: "Matthew Wilcox (Oracle)" To: Alexander Viro Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org Subject: [PATCH 5/5] ufs: Convert ufs_change_blocknr() to take a folio Date: Sat, 5 Oct 2024 19:02:08 +0100 Message-ID: <20241005180214.3181728-6-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241005180214.3181728-1-willy@infradead.org> References: <20241005180214.3181728-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now that ufs_new_fragments() has a folio, pass it to ufs_change_blocknr() as a folio instead of converting it from folio to page to folio. This removes the last use of struct page in UFS. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ufs/balloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c index 2abe13d07f85..8709954adb2a 100644 --- a/fs/ufs/balloc.c +++ b/fs/ufs/balloc.c @@ -234,13 +234,13 @@ void ufs_free_blocks(struct inode *inode, u64 fragment, unsigned count) * situated at the end of file. * * We can come here from ufs_writepage or ufs_prepare_write, - * locked_page is argument of these functions, so we already lock it. + * locked_folio is argument of these functions, so we already lock it. */ static void ufs_change_blocknr(struct inode *inode, sector_t beg, unsigned int count, sector_t oldb, - sector_t newb, struct page *locked_page) + sector_t newb, struct folio *locked_folio) { - struct folio *folio, *locked_folio = page_folio(locked_page); + struct folio *folio; const unsigned blks_per_page = 1 << (PAGE_SHIFT - inode->i_blkbits); const unsigned mask = blks_per_page - 1; @@ -466,7 +466,7 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment, mutex_unlock(&UFS_SB(sb)->s_lock); ufs_change_blocknr(inode, fragment - oldcount, oldcount, uspi->s_sbbase + tmp, - uspi->s_sbbase + result, &locked_folio->page); + uspi->s_sbbase + result, locked_folio); *err = 0; write_seqlock(&UFS_I(inode)->meta_lock); ufs_cpu_to_data_ptr(sb, p, result);