summaryrefslogtreecommitdiff
path: root/include/linux/mm_types.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2023-01-24 23:34:29 +0300
committerAndrew Morton <akpm@linux-foundation.org>2023-02-10 03:51:44 +0300
commitf04740f54594f85935e29a5c8ff6722f427f3dac (patch)
treee614e648b05e64f26d5f7b410af90921b4dea681 /include/linux/mm_types.h
parent6e4382c706f7701c4e4e430ebc9f817eeda64857 (diff)
downloadlinux-f04740f54594f85935e29a5c8ff6722f427f3dac.tar.xz
mm/gup: add FOLL_UNLOCKABLE
Setting FOLL_UNLOCKABLE allows GUP to lock/unlock the mmap lock on its own. It is a more explicit replacement for locked != NULL. This clears the way for passing in locked = 1, without intending that the lock can be unlocked. Set the flag in all cases where it is used, eg locked is present in the external interface or locked is used internally with locked = 0. Link: https://lkml.kernel.org/r/8-v2-987e91b59705+36b-gup_tidy_jgg@nvidia.com Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Acked-by: Mike Rapoport (IBM) <rppt@kernel.org> Reviewed-by: John Hubbard <jhubbard@nvidia.com> Cc: Alistair Popple <apopple@nvidia.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Claudio Imbrenda <imbrenda@linux.ibm.com> Cc: David Hildenbrand <david@redhat.com> Cc: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/mm_types.h')
-rw-r--r--include/linux/mm_types.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 4396c7bf06d1..434b3ac8a351 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -1104,5 +1104,6 @@ typedef unsigned int __bitwise zap_flags_t;
#define FOLL_FAST_ONLY 0x80000 /* gup_fast: prevent fall-back to slow gup */
#define FOLL_PCI_P2PDMA 0x100000 /* allow returning PCI P2PDMA pages */
#define FOLL_INTERRUPTIBLE 0x200000 /* allow interrupts from generic signals */
+#define FOLL_UNLOCKABLE 0x400000 /* allow unlocking the mmap lock (internal only) */
#endif /* _LINUX_MM_TYPES_H */