From 7f8e05f60c87646e12c761fef61dd71a7e67112e Mon Sep 17 00:00:00 2001 From: David Howells Date: Fri, 3 Apr 2009 16:42:45 +0100 Subject: 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 Acked-by: Steve Dickson Acked-by: Trond Myklebust Acked-by: Al Viro Tested-by: Daire Byrne --- fs/nfs/read.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fs/nfs/read.c') diff --git a/fs/nfs/read.c b/fs/nfs/read.c index e18ba792872f..4ace3c50a8eb 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", -- cgit v1.2.3-59-g8ed1b