summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-29 18:50:01 +0200
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-05-01 21:42:41 +0200
commit8d197a568fc337c66729b289c7fa0f28c14ba5ac (patch)
treed4a7ff5108863b8ad0dba5f28a589fdd14ffff64
parentNFS: Optimise away nfs_check_inode_attributes() when holding a delegation (diff)
downloadlinux-8d197a568fc337c66729b289c7fa0f28c14ba5ac.tar.xz
linux-8d197a568fc337c66729b289c7fa0f28c14ba5ac.zip
NFS: Always trust the PageUptodate flag when we have a delegation
We can always use the optimal full page write if we know that we hold a delegation. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/write.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index d1e4f81ba057..6f263daac748 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -850,10 +850,14 @@ int nfs_flush_incompatible(struct file *file, struct page *page)
* the PageUptodate() flag. In this case, we will need to turn off
* write optimisations that depend on the page contents being correct.
*/
-static int nfs_write_pageuptodate(struct page *page, struct inode *inode)
+static bool nfs_write_pageuptodate(struct page *page, struct inode *inode)
{
- return PageUptodate(page) &&
- !(NFS_I(inode)->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA));
+ if (nfs_have_delegated_attributes(inode))
+ goto out;
+ if (NFS_I(inode)->cache_validity & NFS_INO_REVAL_PAGECACHE)
+ return false;
+out:
+ return PageUptodate(page) != 0;
}
/*