* [PATCH 01/10] filemap: Add folio_next_pos()
[not found] <20251024170822.1427218-1-willy@infradead.org>
@ 2025-10-24 17:08 ` Matthew Wilcox (Oracle)
2025-10-27 7:53 ` Christoph Hellwig
2025-10-27 8:33 ` Joseph Qi
0 siblings, 2 replies; 3+ messages in thread
From: Matthew Wilcox (Oracle) @ 2025-10-24 17:08 UTC (permalink / raw)
To: linux-fsdevel, Christian Brauner
Cc: Matthew Wilcox (Oracle), Mark Fasheh, Joel Becker, Joseph Qi,
ocfs2-devel
Replace the open-coded implementation in ocfs2 (which loses the top
32 bits on 32-bit architectures) with a helper in pagemap.h.
Fixes: 35edec1d52c0 (ocfs2: update truncate handling of partial clusters)
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: ocfs2-devel@lists.linux.dev
---
fs/ocfs2/alloc.c | 2 +-
include/linux/pagemap.h | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 162711cc5b20..b267ec580da9 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -6892,7 +6892,7 @@ static void ocfs2_zero_cluster_folios(struct inode *inode, loff_t start,
ocfs2_map_and_dirty_folio(inode, handle, from, to, folio, 1,
&phys);
- start = folio_next_index(folio) << PAGE_SHIFT;
+ start = folio_next_pos(folio);
}
out:
if (folios)
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 09b581c1d878..e16576e3763a 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -941,6 +941,17 @@ static inline pgoff_t folio_next_index(const struct folio *folio)
return folio->index + folio_nr_pages(folio);
}
+/**
+ * folio_next_pos - Get the file position of the next folio.
+ * @folio: The current folio.
+ *
+ * Return: The position of the folio which follows this folio in the file.
+ */
+static inline loff_t folio_next_pos(const struct folio *folio)
+{
+ return (loff_t)folio_next_index(folio) << PAGE_SHIFT;
+}
+
/**
* folio_file_page - The page for a particular index.
* @folio: The folio which contains this index.
--
2.47.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 01/10] filemap: Add folio_next_pos()
2025-10-24 17:08 ` [PATCH 01/10] filemap: Add folio_next_pos() Matthew Wilcox (Oracle)
@ 2025-10-27 7:53 ` Christoph Hellwig
2025-10-27 8:33 ` Joseph Qi
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2025-10-27 7:53 UTC (permalink / raw)
To: Matthew Wilcox (Oracle)
Cc: linux-fsdevel, Christian Brauner, Mark Fasheh, Joel Becker,
Joseph Qi, ocfs2-devel
On Fri, Oct 24, 2025 at 06:08:09PM +0100, Matthew Wilcox (Oracle) wrote:
> Replace the open-coded implementation in ocfs2 (which loses the top
> 32 bits on 32-bit architectures) with a helper in pagemap.h.
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 01/10] filemap: Add folio_next_pos()
2025-10-24 17:08 ` [PATCH 01/10] filemap: Add folio_next_pos() Matthew Wilcox (Oracle)
2025-10-27 7:53 ` Christoph Hellwig
@ 2025-10-27 8:33 ` Joseph Qi
1 sibling, 0 replies; 3+ messages in thread
From: Joseph Qi @ 2025-10-27 8:33 UTC (permalink / raw)
To: Matthew Wilcox (Oracle), linux-fsdevel, Christian Brauner
Cc: Mark Fasheh, Joel Becker, ocfs2-devel
On 2025/10/25 01:08, Matthew Wilcox (Oracle) wrote:
> Replace the open-coded implementation in ocfs2 (which loses the top
> 32 bits on 32-bit architectures) with a helper in pagemap.h.
>
> Fixes: 35edec1d52c0 (ocfs2: update truncate handling of partial clusters)
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Cc: Mark Fasheh <mark@fasheh.com>
> Cc: Joel Becker <jlbec@evilplan.org>
> Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
> Cc: ocfs2-devel@lists.linux.dev
Looks fine.
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
> fs/ocfs2/alloc.c | 2 +-
> include/linux/pagemap.h | 11 +++++++++++
> 2 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
> index 162711cc5b20..b267ec580da9 100644
> --- a/fs/ocfs2/alloc.c
> +++ b/fs/ocfs2/alloc.c
> @@ -6892,7 +6892,7 @@ static void ocfs2_zero_cluster_folios(struct inode *inode, loff_t start,
> ocfs2_map_and_dirty_folio(inode, handle, from, to, folio, 1,
> &phys);
>
> - start = folio_next_index(folio) << PAGE_SHIFT;
> + start = folio_next_pos(folio);
> }
> out:
> if (folios)
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 09b581c1d878..e16576e3763a 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -941,6 +941,17 @@ static inline pgoff_t folio_next_index(const struct folio *folio)
> return folio->index + folio_nr_pages(folio);
> }
>
> +/**
> + * folio_next_pos - Get the file position of the next folio.
> + * @folio: The current folio.
> + *
> + * Return: The position of the folio which follows this folio in the file.
> + */
> +static inline loff_t folio_next_pos(const struct folio *folio)
> +{
> + return (loff_t)folio_next_index(folio) << PAGE_SHIFT;
> +}
> +
> /**
> * folio_file_page - The page for a particular index.
> * @folio: The folio which contains this index.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-27 8:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20251024170822.1427218-1-willy@infradead.org>
2025-10-24 17:08 ` [PATCH 01/10] filemap: Add folio_next_pos() Matthew Wilcox (Oracle)
2025-10-27 7:53 ` Christoph Hellwig
2025-10-27 8:33 ` Joseph Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).