mm/gup: move private gup FOLL_ flags to internal.h
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 24 Jan 2023 20:34:34 +0000 (16:34 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 10 Feb 2023 00:51:45 +0000 (16:51 -0800)
commit2c2241081f7dec878331fdc3a3f2361e99556bca
treee5ca9e9d46b394af7536f51581d2d2bbda7ed5b0
parent63b605128655f2e3968d99e30b293c7e7eaa2fc2
mm/gup: move private gup FOLL_ flags to internal.h

Move the flags that should not/are not used outside gup.c and related into
mm/internal.h to discourage driver abuse.

To make this more maintainable going forward compact the two FOLL ranges
with new bit numbers from 0 to 11 and 16 to 21, using shifts so it is
explicit.

Switch to an enum so the whole thing is easier to read.

Link: https://lkml.kernel.org/r/13-v2-987e91b59705+36b-gup_tidy_jgg@nvidia.com
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Mike Rapoport (IBM) <rppt@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mm_types.h
mm/internal.h