Thread (3 messages) 3 messages, 2 authors, 2010-01-13

Re: [PATCH v4][RESENT] add MAP_UNLOCKED mmap flag

From: Gleb Natapov <hidden>
Date: 2010-01-13 09:29:45
Also in: linux-mm, lkml

On Tue, Jan 12, 2010 at 03:21:45PM -0800, Chris Wright wrote:
* Gleb Natapov (gleb@redhat.com) wrote:
quoted
 v3->v4
  - return error if MAP_LOCKED | MAP_UNLOCKED is specified
...
quoted
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -962,6 +962,12 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
 		if (!can_do_mlock())
 			return -EPERM;
 
+        if (flags & MAP_UNLOCKED)
+                vm_flags &= ~VM_LOCKED;
+
+        if (flags & MAP_UNLOCKED)
+                vm_flags &= ~VM_LOCKED;
+
 	/* mlock MCL_FUTURE? */
 	if (vm_flags & VM_LOCKED) {
 		unsigned long locked, lock_limit;
Looks like same patch applied twice rather than adding the
(MAP_LOCKED | MAP_UNLOCKED) check.
Thanks Chris, will resend.

--
			Gleb.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help