Commit 8d197a56 authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 01da47bd
...@@ -850,10 +850,14 @@ int nfs_flush_incompatible(struct file *file, struct page *page) ...@@ -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 * the PageUptodate() flag. In this case, we will need to turn off
* write optimisations that depend on the page contents being correct. * 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) && if (nfs_have_delegated_attributes(inode))
!(NFS_I(inode)->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA)); goto out;
if (NFS_I(inode)->cache_validity & NFS_INO_REVAL_PAGECACHE)
return false;
out:
return PageUptodate(page) != 0;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment