From: Carsten Otte Date: Fri, 24 Jun 2005 05:05:29 +0000 (-0700) Subject: [PATCH] xip: madvice/fadvice: execute in place X-Git-Tag: v2.6.13-rc1~68^2~257 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=fe77ba6f4f97690baa4c756611a07f3cc033f6ae;p=linux-2.6-omap-h63xx.git [PATCH] xip: madvice/fadvice: execute in place Make sys_madvice/fadvice return sane with xip. Signed-off-by: Carsten Otte Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/fadvise.c b/mm/fadvise.c index 57264d74b8b..5f19e87bc5a 100644 --- a/mm/fadvise.c +++ b/mm/fadvise.c @@ -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) diff --git a/mm/madvise.c b/mm/madvise.c index 54a5d3bc55d..73180a22877 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -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)