Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320788
b: refs/heads/master
c: 3d3727c
h: refs/heads/master
v: v3
  • Loading branch information
KOSAKI Motohiro authored and Linus Torvalds committed Aug 1, 2012
1 parent dd4ee3c commit 514ab97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 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: c59e26104e3e0e952cd7d63e79cd71ee5a9ec25a
refs/heads/master: 3d3727cdb07ff17ddc3c551ef8d03d37b60a0372
18 changes: 7 additions & 11 deletions trunk/mm/fadvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
spin_unlock(&file->f_lock);
break;
case POSIX_FADV_WILLNEED:
if (!mapping->a_ops->readpage) {
ret = -EINVAL;
break;
}

/* First and last PARTIAL page! */
start_index = offset >> PAGE_CACHE_SHIFT;
end_index = endbyte >> PAGE_CACHE_SHIFT;
Expand All @@ -106,12 +101,13 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
nrpages = end_index - start_index + 1;
if (!nrpages)
nrpages = ~0UL;

ret = force_page_cache_readahead(mapping, file,
start_index,
nrpages);
if (ret > 0)
ret = 0;

/*
* Ignore return value because fadvise() shall return
* success even if filesystem can't retrieve a hint,
*/
force_page_cache_readahead(mapping, file, start_index,
nrpages);
break;
case POSIX_FADV_NOREUSE:
break;
Expand Down

0 comments on commit 514ab97

Please sign in to comment.