]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] xip: madvice/fadvice: execute in place
authorCarsten Otte <cotte@de.ibm.com>
Fri, 24 Jun 2005 05:05:29 +0000 (22:05 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 24 Jun 2005 07:06:42 +0000 (00:06 -0700)
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>
mm/fadvise.c
mm/madvise.c

index 57264d74b8bff0528dd09456c4c81d6c6785363c..5f19e87bc5af1c86dd121d7e50dcd3e5cc1c7e94 100644 (file)
@@ -43,6 +43,10 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
                goto out;
        }
 
+       if (mapping->a_ops->get_xip_page)
+               /* no bad return value, but ignore advice */
+               goto out;
+
        /* Careful about overflows. Len == 0 means "as much as possible" */
        endbyte = offset + len;
        if (!len || endbyte < len)
index 54a5d3bc55d501caa3d2da3f3a9ef265ca584f2a..73180a22877ed24bcbd01fbca9a2be10c799df2f 100644 (file)
@@ -86,6 +86,11 @@ static long madvise_willneed(struct vm_area_struct * vma,
        if (!file)
                return -EBADF;
 
+       if (file->f_mapping->a_ops->get_xip_page) {
+               /* no bad return value, but ignore advice */
+               return 0;
+       }
+
        *prev = vma;
        start = ((start - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
        if (end > vma->vm_end)