Skip to content

Commit

Permalink
[PATCH] xip: madvice/fadvice: execute in place
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Carsten Otte authored and Linus Torvalds committed Jun 24, 2005
1 parent eb6fe0c commit fe77ba6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mm/fadvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions mm/madvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fe77ba6

Please sign in to comment.