On 11/18/22 12:00, Jason Gunthorpe wrote:
...
Even after this cleanup, gup.c is still a bit of a ball of string, what
with things like __gup_longterm_locked() actually handling
!FOLL_LONGTERM, and a bunch of other vestigial stuff, but this takes us
in the right direction.
What do you think of this:
https://github.com/jgunthorpe/linux/commits/gup
I like it--this cleans things up a lot!
A couple of tweaks I'd suggest would be:
1) Add an enum for "1" to the new enum, and use it. That will clarify
the call sites in the same way that GUP_GET_LOCK helps.
2) Don't change the name of the is_valid_gup_flags(). Or at least,
leave some for is "is_" in there. Because that makes the call sites
very nice:
if (!is_valid_gup_flags())
...bail out, etc
thanks,
--
John Hubbard
NVIDIA