[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250918-origin-dev-v1-1-8d9877df9e77@amlogic.com>
Date: Thu, 18 Sep 2025 03:32:42 +0000
From: Jiucheng Xu via B4 Relay <devnull+jiucheng.xu.amlogic.com@...nel.org>
To: Jaegeuk Kim <jaegeuk@...nel.org>, Chao Yu <chao@...nel.org>
Cc: linux-f2fs-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
tuan.zhang@...ogic.com, jianxin.pan@...ogic.com,
Jiucheng Xu <jiucheng.xu@...ogic.com>
Subject: [PATCH] f2fs: Use mapping->gfp_mask to get file cache for writing
From: Jiucheng Xu <jiucheng.xu@...ogic.com>
On 32-bit architectures, when GFP_NOFS is used, the file cache for write
operations cannot be allocated from the highmem and CMA.
Since mapping->gfp_mask is set to GFP_HIGHUSER_MOVABLE during inode
allocation, using mapping_gfp_mask(mapping) as the GFP flag of getting file
cache for writing is more efficient for 32-bit architectures.
Signed-off-by: Jiucheng Xu <jiucheng.xu@...ogic.com>
---
fs/f2fs/data.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 7961e0ddfca3aaa332b7dbd4985ae7766551834f..9fbc41f9accb2626da22754f1a424da4805ca823 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3587,7 +3587,8 @@ static int f2fs_write_begin(const struct kiocb *iocb,
* Will wait that below with our IO control.
*/
folio = __filemap_get_folio(mapping, index,
- FGP_LOCK | FGP_WRITE | FGP_CREAT, GFP_NOFS);
+ FGP_LOCK | FGP_WRITE | FGP_CREAT,
+ mapping_gfp_mask(mapping));
if (IS_ERR(folio)) {
err = PTR_ERR(folio);
goto fail;
---
base-commit: c872b6279cd26762339ff02513e2a3f16149a6f1
change-id: 20250910-origin-dev-8a5ff6bee1f2
Best regards,
--
Jiucheng Xu <jiucheng.xu@...ogic.com>
Powered by blists - more mailing lists