Thread (128 messages) 128 messages, 3 authors, 2021-06-28

Re: [PATCH v2 43/46] mm/filemap: Add filemap_add_folio

From: Matthew Wilcox <willy@infradead.org>
Date: 2021-06-25 01:57:45
Also in: linux-fsdevel, lkml

On Wed, Jun 23, 2021 at 01:30:04PM +0200, Christoph Hellwig wrote:
On Tue, Jun 22, 2021 at 01:15:48PM +0100, Matthew Wilcox (Oracle) wrote:
quoted
Pages being added to the page cache should already be folios, so
just cast the page to a folio in the add_to_page_cache_lru() wrapper.
Saves 96 bytes of text.
modulo the casting:
ok.  Moved add_to_page_cache_lru() into folio-compat.c, added the call
to page_folio() and also added:

        if (!huge) {
+               VM_BUG_ON_FOLIO(index & (folio_nr_pages(folio) - 1), folio);
                error = folio_charge_cgroup(folio, current->mm, gfp);

as we don't want pages added at an unaligned index in the file.
Reviewed-by: Christoph Hellwig <hch@lst.de>
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help