Commit fe77ba6f4f97690baa4c756611a07f3cc033f6ae

Authored by Carsten Otte
Committed by Linus Torvalds
1 parent eb6fe0c388

[PATCH] xip: madvice/fadvice: execute in place

Make sys_madvice/fadvice return sane with xip.

Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 2 changed files with 9 additions and 0 deletions Side-by-side Diff

... ... @@ -43,6 +43,10 @@
43 43 goto out;
44 44 }
45 45  
  46 + if (mapping->a_ops->get_xip_page)
  47 + /* no bad return value, but ignore advice */
  48 + goto out;
  49 +
46 50 /* Careful about overflows. Len == 0 means "as much as possible" */
47 51 endbyte = offset + len;
48 52 if (!len || endbyte < len)
... ... @@ -86,6 +86,11 @@
86 86 if (!file)
87 87 return -EBADF;
88 88  
  89 + if (file->f_mapping->a_ops->get_xip_page) {
  90 + /* no bad return value, but ignore advice */
  91 + return 0;
  92 + }
  93 +
89 94 *prev = vma;
90 95 start = ((start - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
91 96 if (end > vma->vm_end)