lkml.org 
[lkml]   [2020]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 13/16] mm: Pass pvec directly to find_get_entries
On Sat, Nov 14, 2020 at 11:21:33AM +0100, Christoph Hellwig wrote:
> On Thu, Nov 12, 2020 at 09:26:38PM +0000, Matthew Wilcox (Oracle) wrote:
> > + pvec->nr = ret;
> > return ret;
>
> Do we need to return the number of found entries in addition to storing
> it in the pagevec?

We really only need a bool -- is pvec->nr zero or not. But we have the
number calculated so we may as well return it. All the current find_*()
behave this way and I haven't seen enough reason to change it yet.
Making it return void just makes the callers uglier. I have a batch of
patches to do something similar for find_get_pages / find_get_pages_range
/ pagevec_lookup / pagevec_lookup_range, but I don't need them for the
THP patchset, so I haven't sent them yet.

\
 
 \ /
  Last update: 2020-11-14 16:24    [W:0.045 / U:1.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site