• Vishal Moola (Oracle)'s avatar
    ramfs: convert ramfs_nommu_get_unmapped_area() to use filemap_get_folios_contig() · 60aac486
    Vishal Moola (Oracle) authored
    Convert to use folios throughout.  This is in preparation for the removal
    for find_get_pages_contig().  Now also supports large folios.
    
    The initial version of this function set the page_address to be returned
    after finishing all the checks.  Since folio_batches have a maximum of 15
    folios, the function had to be modified to support getting and checking up
    to lpages, 15 pages at a time while still returning the initial page
    address.  Now the function sets ret as soon as the first batch arrives,
    and updates it only if a check fails.
    
    The physical adjacency check utilizes the page frame numbers.  The page
    frame number of each folio must be nr_pages away from the first folio.
    
    Link: https://lkml.kernel.org/r/20220824004023.77310-7-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Chris Mason <clm@fb.com>
    Cc: David Sterba <dsterba@suse.com>
    Cc: David Sterba <dsterb@suse.com>
    Cc: Josef Bacik <josef@toxicpanda.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Ryusuke Konishi <konishi.ryusuke@gmail.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    60aac486
file-nommu.c 6.98 KB