mm, fadvise: don't return -EINVAL when filesystem cannot implement fadvise()
mm, fadvise: don't return -EINVAL when filesystem cannot implement fadvise()

Eric Wong reported his test suite failex when /tmp is tmpfs.

https://lkml.org/lkml/2012/2/24/479

Currentlt the input check of POSIX_FADV_WILLNEED has two problems.

- requires a_ops->readpage.  But in fact, force_page_cache_readahead()
  requires that the target filesystem has either ->readpage or ->readpages.

- returns -EINVAL when the filesystem doesn't have ->readpage.  But
  posix says that fadvise is merely a hint.  Thus fadvise() should return
  0 if filesystem has no means of implementing fadvise().  The userland
  application should not know nor care whcih type of filesystem backs the
  TMPDIR directory, as Eric pointed out.  There is nothing which userspace
  can do to solve this error.

So change the return value to 0 when filesytem doesn't support readahead.

[5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org: checkpatch fixes]
Signed-off-by: KOSAKI Motohiro <70a1d3ef3e17a2bb0f09a1b2e6c86f607ed1d6d9@jp.fujitsu.com>
Cc: Hugh Dickins <d3abdf3e2800e6cb849f11b81e6eb50b34d96431@google.com>
Cc: Hillf Danton <74636c4e14be88f42bc2a57784d7913ef47ac9b0@gmail.com>
Signed-off-by: Eric Wong <8c2951295f8292b0c03727bc4652981172298eae@yhbt.net>
Tested-by: Eric Wong <8c2951295f8292b0c03727bc4652981172298eae@yhbt.net>
Reviewed-by: Wanlong Gao <209b351814c2aa2d43085ca51a9830225b84821b@cn.fujitsu.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs