splice: Clean up direct_splice_read() a bit
authorDavid Howells <dhowells@redhat.com>
Wed, 15 Mar 2023 16:35:35 +0000 (16:35 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 15 Mar 2023 17:46:47 +0000 (11:46 -0600)
commite75f0c6756708174a6e345ca56476e7fa291b0df
tree2491fc68e9995bfb716e8db33361eacec6ce7f7a
parenteeac8ede17557680855031c6f305ece2378af326
splice: Clean up direct_splice_read() a bit

Do a couple of cleanups to direct_splice_read():

 (1) Cast to struct page **, not void *.

 (2) Simplify the calculation of the number of pages to keep/reclaim in
     direct_splice_read().

Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
cc: Jens Axboe <axboe@kernel.dk>
cc: Al Viro <viro@zeniv.linux.org.uk>
cc: David Hildenbrand <david@redhat.com>
cc: John Hubbard <jhubbard@nvidia.com>
cc: linux-mm@kvack.org
cc: linux-block@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
Link: https://lore.kernel.org/r/20230315163549.295454-2-dhowells@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/splice.c