[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250421105026.19577-2-chentaotao@didiglobal.com>
Date: Mon, 21 Apr 2025 10:50:30 +0000
From: 陈涛涛 Taotao Chen <chentaotao@...iglobal.com>
To: "tytso@....edu" <tytso@....edu>, "adilger.kernel@...ger.ca"
<adilger.kernel@...ger.ca>, "akpm@...ux-foundation.org"
<akpm@...ux-foundation.org>, "willy@...radead.org" <willy@...radead.org>
CC: "linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
陈涛涛 Taotao Chen <chentaotao@...iglobal.com>
Subject: [PATCH 1/3] mm/filemap: initialize fsdata with iocb->ki_flags
From: Taotao Chen <chentaotao@...iglobal.com>
Initialize fsdata with &iocb->ki_flags to allow filesystems to check
iocb flags like IOCB_DONTCACHE during ->write_begin().
Signed-off-by: Taotao Chen <chentaotao@...iglobal.com>
---
mm/filemap.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mm/filemap.c b/mm/filemap.c
index 7b90cbeb4a1a..9174b6310f0b 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -4087,7 +4087,11 @@ ssize_t generic_perform_write(struct kiocb *iocb, struct iov_iter *i)
size_t offset; /* Offset into folio */
size_t bytes; /* Bytes to write to folio */
size_t copied; /* Bytes copied from user */
- void *fsdata = NULL;
+ /*
+ * Initialize fsdata with iocb flags pointer so that filesystems
+ * can check ki_flags (like IOCB_DONTCACHE) in write operations.
+ */
+ void *fsdata = &iocb->ki_flags;
bytes = iov_iter_count(i);
retry:
--
2.34.1
Powered by blists - more mailing lists