]> Gentwo Git Trees - linux/.git/commit
fb_defio: do not use deprecated page->mapping, index fields
authorLorenzo Stoakes <lorenzo.stoakes@oracle.com>
Sat, 8 Feb 2025 15:52:56 +0000 (15:52 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 23 Feb 2025 06:25:20 +0000 (22:25 -0800)
commit6097a25d252f88e0a69491568002d217a32ae312
tree145ccd7d3ec8c18557f8deb753328bdb70968a8a
parent503e8db377a99efbd48a3d0c0634e0a6789be11e
fb_defio: do not use deprecated page->mapping, index fields

With the introduction of mapping_wrprotect_range() there is no need to use
folio_mkclean() in order to write-protect mappings of frame buffer pages,
and therefore no need to inappropriately set kernel-allocated page->index,
mapping fields to permit this operation.

Instead, store the pointer to the page cache object for the mapped driver
in the fb_deferred_io object, and use the already stored page offset from
the pageref object to look up mappings in order to write-protect them.

This is justified, as for the page objects to store a mapping pointer at
the point of assignment of pages, they must all reference the same
underlying address_space object.  Since the life time of the pagerefs is
also the lifetime of the fb_deferred_io object, storing the pointer here
makes sense.

This eliminates the need for all of the logic around setting and
maintaining page->index,mapping which we remove.

This eliminates the use of folio_mkclean() entirely but otherwise should
have no functional change.

Link: https://lkml.kernel.org/r/81171ab16c14e3df28f6de9d14982cee528d8519.1739029358.git.lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Tested-by: Kajtar Zsolt <soci@c64.rulez.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Hildenbrand <david@redhat.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: MaĆ­ra Canal <mcanal@igalia.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Simona Vetter <simona.vetter@ffwll.ch>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/video/fbdev/core/fb_defio.c
include/linux/fb.h