summaryrefslogtreecommitdiff
path: root/fs/nfs/read.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-04-03 16:42:45 +0100
committerDavid Howells <dhowells@redhat.com>2009-04-03 16:42:45 +0100
commit7f8e05f60c87646e12c761fef61dd71a7e67112e (patch)
treef33bfcd5b4662a48890e8245362b381437be76fb /fs/nfs/read.c
parent9a9fc1c03315f1606596e55b4096d39e2079a041 (diff)
downloadlinux-3.10-7f8e05f60c87646e12c761fef61dd71a7e67112e.tar.gz
linux-3.10-7f8e05f60c87646e12c761fef61dd71a7e67112e.tar.bz2
linux-3.10-7f8e05f60c87646e12c761fef61dd71a7e67112e.zip
NFS: Store pages from an NFS inode into a local cache
Store pages from an NFS inode into the cache data storage object associated with that inode. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Steve Dickson <steved@redhat.com> Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
Diffstat (limited to 'fs/nfs/read.c')
-rw-r--r--fs/nfs/read.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index e18ba792872..4ace3c50a8e 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -140,6 +140,11 @@ int nfs_readpage_async(struct nfs_open_context *ctx, struct inode *inode,
static void nfs_readpage_release(struct nfs_page *req)
{
+ struct inode *d_inode = req->wb_context->path.dentry->d_inode;
+
+ if (PageUptodate(req->wb_page))
+ nfs_readpage_to_fscache(d_inode, req->wb_page, 0);
+
unlock_page(req->wb_page);
dprintk("NFS: read done (%s/%Ld %d@%Ld)\n",