Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9805
b: refs/heads/master
c: 1bef400
h: refs/heads/master
i:
  9803: aefaf3f
v: v3
  • Loading branch information
Suzuki authored and Linus Torvalds committed Oct 11, 2005
1 parent 66d644e commit 37787ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 22c1ea44f0d33eda532883858b6cdabc5f265b66
refs/heads/master: 1bef40032992320dd25a266fc166bfb8fa3f2f59
11 changes: 4 additions & 7 deletions trunk/mm/madvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ static long madvise_willneed(struct vm_area_struct * vma,
{
struct file *file = vma->vm_file;

if (!file)
return -EBADF;

if (file->f_mapping->a_ops->get_xip_page) {
/* no bad return value, but ignore advice */
return 0;
Expand Down Expand Up @@ -141,11 +144,7 @@ static long
madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev,
unsigned long start, unsigned long end, int behavior)
{
struct file *filp = vma->vm_file;
long error = -EBADF;

if (!filp)
goto out;
long error;

switch (behavior) {
case MADV_NORMAL:
Expand All @@ -166,8 +165,6 @@ madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev,
error = -EINVAL;
break;
}

out:
return error;
}

Expand Down

0 comments on commit 37787ea

Please sign in to comment.