Thread (38 messages) 38 messages, 7 authors, 2016-10-20

Re: [PATCH 04/10] mm: replace get_user_pages_locked() write/force parameters with gup_flags

From: Jan Kara <jack@suse.cz>
Date: 2016-10-18 12:54:25
Also in: ceph-devel, dri-devel, intel-gfx, kvm, linux-alpha, linux-arm-kernel, linux-fsdevel, linux-media, linux-mips, linux-mm, linux-rdma, linux-s390, linux-samsung-soc, linux-scsi, linux-sh, linuxppc-dev, lkml, netdev, sparclinux

On Thu 13-10-16 01:20:14, Lorenzo Stoakes wrote:
quoted hunk ↗ jump to hunk
This patch removes the write and force parameters from get_user_pages_locked()
and replaces them with a gup_flags parameter to make the use of FOLL_FORCE
explicit in callers as use of this flag can result in surprising behaviour (and
hence bugs) within the mm subsystem.

Signed-off-by: Lorenzo Stoakes <redacted>
---
 include/linux/mm.h |  2 +-
 mm/frame_vector.c  |  8 +++++++-
 mm/gup.c           | 12 +++---------
 mm/nommu.c         |  5 ++++-
 4 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 6adc4bc..27ab538 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1282,7 +1282,7 @@ long get_user_pages(unsigned long start, unsigned long nr_pages,
 			    int write, int force, struct page **pages,
 			    struct vm_area_struct **vmas);
 long get_user_pages_locked(unsigned long start, unsigned long nr_pages,
-		    int write, int force, struct page **pages, int *locked);
+		    unsigned int gup_flags, struct page **pages, int *locked);
Hum, the prototype is inconsistent with e.g. __get_user_pages_unlocked()
where gup_flags come after **pages argument. Actually it makes more sense
to have it before **pages so that input arguments come first and output
arguments second but I don't care that much. But it definitely should be
consistent...

								Honza
-- 
Jan Kara [off-list ref]
SUSE Labs, CR
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help