aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorMichel Lespinasse <walken@google.com>2013-02-22 19:32:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 20:50:11 -0500
commit41badc15cbad0350de34408c1b0c690f9df76d4b (patch)
tree2545134398b99b37259bf6412a0bb56442f120fa /mm/mmap.c
parent1869305009857cdeaabe6283bcdc2359c5784543 (diff)
mm: make do_mmap_pgoff return populate as a size in bytes, not as a bool
do_mmap_pgoff() rounds up the desired size to the next PAGE_SIZE multiple, however there was no equivalent code in mm_populate(), which caused issues. This could be fixed by introduced the same rounding in mm_populate(), however I think it's preferable to make do_mmap_pgoff() return populate as a size rather than as a boolean, so we don't have to duplicate the size rounding logic in mm_populate(). Signed-off-by: Michel Lespinasse <walken@google.com> Acked-by: Rik van Riel <riel@redhat.com> Tested-by: Andy Lutomirski <luto@amacapital.net> Cc: Greg Ungerer <gregungerer@westnet.com.au> Cc: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index 39a3944e1658..44bb4d869884 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1163,13 +1163,13 @@ static inline unsigned long round_hint_to_min(unsigned long hint)
1163unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, 1163unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
1164 unsigned long len, unsigned long prot, 1164 unsigned long len, unsigned long prot,
1165 unsigned long flags, unsigned long pgoff, 1165 unsigned long flags, unsigned long pgoff,
1166 bool *populate) 1166 unsigned long *populate)
1167{ 1167{
1168 struct mm_struct * mm = current->mm; 1168 struct mm_struct * mm = current->mm;
1169 struct inode *inode; 1169 struct inode *inode;
1170 vm_flags_t vm_flags; 1170 vm_flags_t vm_flags;
1171 1171
1172 *populate = false; 1172 *populate = 0;
1173 1173
1174 /* 1174 /*
1175 * Does the application expect PROT_READ to imply PROT_EXEC? 1175 * Does the application expect PROT_READ to imply PROT_EXEC?
@@ -1307,7 +1307,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
1307 1307
1308 addr = mmap_region(file, addr, len, vm_flags, pgoff); 1308 addr = mmap_region(file, addr, len, vm_flags, pgoff);
1309 if (!IS_ERR_VALUE(addr) && (vm_flags & VM_POPULATE)) 1309 if (!IS_ERR_VALUE(addr) && (vm_flags & VM_POPULATE))
1310 *populate = true; 1310 *populate = len;
1311 return addr; 1311 return addr;
1312} 1312}
1313 1313