From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796491202; b=aUKw3ZvYJib8w3hXc7yPsdh91bqBwqSCPdxhu6LNDgoiDhh4/mYXJ9kmOrCBaPZG+M9v o980zHQ6MqmmWsewdI4DrozsPvCHxpIoAL9E8Baj/TJCG3cwVUmBjjRDMgtCKJPvHYvPP 2cw7N7892srKFhIw8WIBTr/naw5idAfcEchK2dIz+bwvHp7XLTok2U5yNUF1lhL/nEJ21 AVuYbR2MAIcEA4TR5xp8pzASUd5nXl5+W4pO6GV90o68Q1m/VnddZe4JlcxZkcOGtDq4g ZiqJI6JuMGG09tOXlG+4qWBiLU7yn+RcFN8gkZsZg5NJwBjW65YDWoM8hZFJbURB02Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796491202; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=CBa/uiyJopHVFj0z6WaOhiiCtluHFq/AjoDGUinSYxQ=; b=IBnQDhiPDlAiO/Fh5rwsxh3BKyBoh3135J20oKS7hcRt/+xq/9vvtr9moTY1G6mkreTm XmtVNKB328oFqHlstC8SlPm1K4QFBksQ/kQezp7pGpMW0Gf4nOv8+4g0G8tAxoIC9Ttuj hZbzP09paHrTVP3t+5teegrgsuD81BEuSyP3HHpPzc9s5BPutIi+ZhZHhpxTU+hPokfiG XGqyIK0jM1cc/pw+ATmxTu5dWQInTnuWFxC7jJbWY66JnawUUWvIer2n91Q5n20nEduO4 3BYB9K1pm1F9kRlkqsTF82idZ0D/Y4Rx7uiEcVrA316vWclq1LtfZGI03xb2neTvj0A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b="lS4D/B9B"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21A7C606A31F for ; Sat, 5 Dec 2026 17:20:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=lS4D/B9B Received: by smtp.kernel.org (Postfix) with ESMTPSA id A36D51F00936; Sat, 5 Dec 2026 17:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796491201; bh=CBa/uiyJopHVFj0z6WaOhiiCtluHFq/AjoDGUinSYxQ=; h=Date:To:From:In-Reply-To:References:Subject; b=lS4D/B9BphY2ETeAq12T29ES+53JvprNMDpyOph6LXGE/MNmeamVfe82E5Vgg2Yd1 8RVeONw1JDattADqrkKXV5aFx4Myv4Z/5CSaBcaa004Dj55SjrTDLlVBxZxzPUV2je YsSf2YbYjb6salkTIzkcgL89jrcXxLydZVyJ2Fwk= Date: Sat, 05 Dec 2026 09:20:01 -0800 To: mm-commits@vger.kernel.org,mark@fasheh.com,joseph.qi@linux.alibaba.com, jlbec@evilplan.org,hch@lst.de,heming.zhao@suse.com,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261205143959.704982-4-joseph.qi@linux.alibaba.com> References: <20261205143959.704982-4-joseph.qi@linux.alibaba.com> Subject: + ocfs2-add-ocfs2_get_clusters_uncached.patch added to mm-nonmm-unstable branch Message-Id: <20261205172001.A36D51F00936@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: ocfs2: add ocfs2_get_clusters_uncached() has been added to the -mm mm-nonmm-unstable branch. Its filename is ocfs2-add-ocfs2_get_clusters_uncached.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/ocfs2-add-ocfs2_get_clusters_uncached.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Heming Zhao Subject: ocfs2: add ocfs2_get_clusters_uncached() Date: Sat, 05 Dec 2026 22:39:52 +0800 ocfs2_get_clusters() consults the extent map cache, which merges adjacent on-disk records into one. A caller that needs to operate on one on-disk record at a time cannot use it: the returned range may span several records, and inserting the lookup result back into the cache is not wanted either. Factor the lookup into __ocfs2_get_clusters() with a cache flag and add ocfs2_get_clusters_uncached(), which reads the extent tree directly and leaves the cache alone. ocfs2_get_clusters() keeps its current behaviour. No functional change. Link: https://patch.msgid.link/20261205143959.704982-4-joseph.qi@linux.alibaba.com Signed-off-by: Heming Zhao Signed-off-by: Joseph Qi Signed-off-by: Andrew Morton Co-developed-by: Joseph Qi Reviewed-by: Christoph Hellwig Cc: Mark Fasheh Cc: Joel Becker fs/ocfs2/extent_map.c | 34 ++++++++++++++++++++++++++-------- fs/ocfs2/extent_map.h | 3 +++ 2 files changed, 29 insertions(+), 8 deletions(-) --- a/fs/ocfs2/extent_map.c~ocfs2-add-ocfs2_get_clusters_uncached +++ a/fs/ocfs2/extent_map.c @@ -602,9 +602,9 @@ out: return ret; } -int ocfs2_get_clusters(struct inode *inode, u32 v_cluster, - u32 *p_cluster, u32 *num_clusters, - unsigned int *extent_flags) +static int __ocfs2_get_clusters(struct inode *inode, u32 v_cluster, + u32 *p_cluster, u32 *num_clusters, + unsigned int *extent_flags, bool cache) { int ret; unsigned int hole_len, flags = 0; @@ -617,10 +617,12 @@ int ocfs2_get_clusters(struct inode *ino goto out; } - ret = ocfs2_extent_map_lookup(inode, v_cluster, p_cluster, - num_clusters, extent_flags); - if (ret == 0) - goto out; + if (cache) { + ret = ocfs2_extent_map_lookup(inode, v_cluster, p_cluster, + num_clusters, extent_flags); + if (ret == 0) + goto out; + } ret = ocfs2_read_inode_block(inode, &di_bh); if (ret) { @@ -650,7 +652,8 @@ int ocfs2_get_clusters(struct inode *ino p_cluster, num_clusters); flags = rec.e_flags; - ocfs2_extent_map_insert_rec(inode, &rec); + if (cache) + ocfs2_extent_map_insert_rec(inode, &rec); } if (extent_flags) @@ -661,6 +664,21 @@ out: return ret; } +int ocfs2_get_clusters(struct inode *inode, u32 v_cluster, u32 *p_cluster, + u32 *num_clusters, unsigned int *extent_flags) +{ + return __ocfs2_get_clusters(inode, v_cluster, p_cluster, num_clusters, + extent_flags, true); +} + +int ocfs2_get_clusters_uncached(struct inode *inode, u32 v_cluster, + u32 *p_cluster, u32 *num_clusters, + unsigned int *extent_flags) +{ + return __ocfs2_get_clusters(inode, v_cluster, p_cluster, num_clusters, + extent_flags, false); +} + /* * This expects alloc_sem to be held. The allocation cannot change at * all while the map is in the process of being updated. --- a/fs/ocfs2/extent_map.h~ocfs2-add-ocfs2_get_clusters_uncached +++ a/fs/ocfs2/extent_map.h @@ -32,6 +32,9 @@ void ocfs2_extent_map_insert_rec(struct int ocfs2_get_clusters(struct inode *inode, u32 v_cluster, u32 *p_cluster, u32 *num_clusters, unsigned int *extent_flags); +int ocfs2_get_clusters_uncached(struct inode *inode, u32 v_cluster, + u32 *p_cluster, u32 *num_clusters, + unsigned int *extent_flags); int ocfs2_extent_map_get_blocks(struct inode *inode, u64 v_blkno, u64 *p_blkno, u64 *ret_count, unsigned int *extent_flags); _ Patches currently in -mm which might be from heming.zhao@suse.com are ocfs2-add-new-ocfs2_map_blocks-to-introduce-iomap-feature.patch ocfs2-switch-dio-read-path-from-buffer_head-to-iomap.patch ocfs2-add-ocfs2_get_clusters_uncached.patch ocfs2-refactor-ocfs2_lock_allocators-and-add-a-dio-variant.patch ocfs2-record-the-fsync-transaction-when-cow-makes-clusters-writable.patch ocfs2-rework-the-direct-write-context-for-multi-cluster-mappings.patch ocfs2-switch-dio-write-path-from-buffer_head-to-iomap.patch