diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-04-29 12:50:01 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-01 15:42:41 -0400 |
commit | 8d197a568fc337c66729b289c7fa0f28c14ba5ac (patch) | |
tree | d4a7ff5108863b8ad0dba5f28a589fdd14ffff64 /fs/nfs | |
parent | 01da47bde78ff2149f6546a0f17e25983aaddd7b (diff) |
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>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/write.c | 10 |
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) | |||
850 | * the PageUptodate() flag. In this case, we will need to turn off | 850 | * the PageUptodate() flag. In this case, we will need to turn off |
851 | * write optimisations that depend on the page contents being correct. | 851 | * write optimisations that depend on the page contents being correct. |
852 | */ | 852 | */ |
853 | static int nfs_write_pageuptodate(struct page *page, struct inode *inode) | 853 | static bool nfs_write_pageuptodate(struct page *page, struct inode *inode) |
854 | { | 854 | { |
855 | return PageUptodate(page) && | 855 | if (nfs_have_delegated_attributes(inode)) |
856 | !(NFS_I(inode)->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA)); | 856 | goto out; |
857 | if (NFS_I(inode)->cache_validity & NFS_INO_REVAL_PAGECACHE) | ||
858 | return false; | ||
859 | out: | ||
860 | return PageUptodate(page) != 0; | ||
857 | } | 861 | } |
858 | 862 | ||
859 | /* | 863 | /* |