Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5132
b: refs/heads/master
c: 165cd40
h: refs/heads/master
v: v3
  • Loading branch information
suzuki authored and Linus Torvalds committed Jul 27, 2005
1 parent 8b9f285 commit ff6b8e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 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: 4bfdf37830111321e2cd1fe0102dd776ce93194d
refs/heads/master: 165cd40235732644b1856a5ed5e158c9b93f6010
13 changes: 8 additions & 5 deletions trunk/mm/madvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ 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 @@ -140,11 +137,16 @@ static long madvise_dontneed(struct vm_area_struct * vma,
return 0;
}

static long madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev,
unsigned long start, unsigned long end, int behavior)
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;

switch (behavior) {
case MADV_NORMAL:
case MADV_SEQUENTIAL:
Expand All @@ -165,6 +167,7 @@ static long madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev
break;
}

out:
return error;
}

Expand Down

0 comments on commit ff6b8e2

Please sign in to comment.