]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: add folio_zero_tail() and use it in ext4
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 7 Nov 2023 21:26:40 +0000 (21:26 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 20 Nov 2023 21:16:27 +0000 (13:16 -0800)
commit6f9b5acbc15dcdee3e7ec84ce78e6691d70db2a4
treed63ed991805cc29b73513a8a977cc7376a35a6a1
parenta9bc04b159229838cff2e6a7c4b0ce6d29a9fd09
mm: add folio_zero_tail() and use it in ext4

Patch series "Add folio_zero_tail() and folio_fill_tail()".

I'm trying to make it easier for filesystems with tailpacking / stuffing /
inline data to use folios.  The primary function here is
folio_fill_tail().  You give it a pointer to memory where the data
currently is, and it takes care of copying it into the folio at that
offset.  That works for gfs2 & iomap.  Then There's Ext4.  Rather than gin
up some kind of specialist "Here's a two pointers to two blocks of memory"
routine, just let it do its current thing, and let it call
folio_zero_tail(), which is also called by folio_fill_tail().

Other filesystems can be converted later; these ones seemed like good
examples as they're already partly or completely converted to folios.

This patch (of 3):

Instead of unmapping the folio after copying the data to it, then mapping
it again to zero the tail, provide folio_zero_tail() to zero the tail of
an already-mapped folio.

Link: https://lkml.kernel.org/r/20231107212643.3490372-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20231107212643.3490372-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Cc: Darrick J. Wong <djwong@kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ext4/inline.c
include/linux/highmem.h