cifs: convert wdata_alloc_and_fillpages() to use filemap_get_folios_tag()
authorVishal Moola (Oracle) <vishal.moola@gmail.com>
Wed, 4 Jan 2023 21:14:34 +0000 (13:14 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 3 Feb 2023 06:33:15 +0000 (22:33 -0800)
commit4cda80f3a7a53a0bc66cd9f16f7872524cfdd87d
treefcd3b6a8bfe269838601593ce0e0da88e316a1ed
parent590a2b5f0a9b740e415e0d52bd8a0f87fc15b87b
cifs: convert wdata_alloc_and_fillpages() to use filemap_get_folios_tag()

This is in preparation for the removal of find_get_pages_range_tag().  Now
also supports the use of large folios.

Since tofind might be larger than the max number of folios in a
folio_batch (15), we loop through filling in wdata->pages pulling more
batches until we either reach tofind pages or run out of folios.

This function may not return all pages in the last found folio before
tofind pages are reached.

Link: https://lkml.kernel.org/r/20230104211448.4804-10-vishal.moola@gmail.com
Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Cc: Tom Talpey <tom@talpey.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/cifs/file.c