nfs: remove redundant tests on reading new pages
commite283c6453018d3cec1d696fcd3ecaa9a72b7cff8
authorWu Fengguang <fengguang.wu@intel.com>
Tue, 23 Dec 2008 20:21:30 +0000 (23 15:21 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 18 Jan 2009 18:44:03 +0000 (18 10:44 -0800)
tree0dc34710e3b7b7d920a97a88260dc6a5d3c75309
parentab37645aa3488e0bf3be4dd25dad5d69680e7b9b
nfs: remove redundant tests on reading new pages

commit 136221fc3219b3805c48db5da065e8e3467175d4 upstream.

aops->readpages() and its NFS helper readpage_async_filler() will only
be called to do readahead I/O for newly allocated pages. So it's not
necessary to test for the always 0 dirty/uptodate page flags.

The removal of nfs_wb_page() call also fixes a readahead bug: the NFS
readahead has been synchronous since 2.6.23, because that call will
clear PG_readahead, which is the reminder for asynchronous readahead.

More background: the PG_readahead page flag is shared with PG_reclaim,
one for read path and the other for write path. clear_page_dirty_for_io()
unconditionally clears PG_readahead to prevent possible readahead residuals,
assuming itself to be always called in the write path. However, NFS is one
and the only exception in that it _always_ calls clear_page_dirty_for_io()
in the read path, i.e. for readpages()/readpage().

Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfs/read.c