Commit 7325bea7 authored by Trond Myklebust's avatar Trond Myklebust

[PATCH] Re: better getattr caching..

The following patches to nfs2xdr.c/nfs3xdr.c might be relevant: *entry
points into the page, and so the assignment should be made before we
kunmap().

Also includes a patch that converts references to inode->i_data into
inode->i_mapping.  Not likely to be the source of your hang, but should
still be done for consistency with the rest of the kernel.
parent 386b34c2
...@@ -198,7 +198,7 @@ int find_dirent_page(nfs_readdir_descriptor_t *desc) ...@@ -198,7 +198,7 @@ int find_dirent_page(nfs_readdir_descriptor_t *desc)
dfprintk(VFS, "NFS: find_dirent_page() searching directory page %ld\n", desc->page_index); dfprintk(VFS, "NFS: find_dirent_page() searching directory page %ld\n", desc->page_index);
page = read_cache_page(&inode->i_data, desc->page_index, page = read_cache_page(inode->i_mapping, desc->page_index,
(filler_t *)nfs_readdir_filler, desc); (filler_t *)nfs_readdir_filler, desc);
if (IS_ERR(page)) { if (IS_ERR(page)) {
status = PTR_ERR(page); status = PTR_ERR(page);
...@@ -713,7 +713,7 @@ int nfs_cached_lookup(struct inode *dir, struct dentry *dentry, ...@@ -713,7 +713,7 @@ int nfs_cached_lookup(struct inode *dir, struct dentry *dentry,
desc.page_index = 0; desc.page_index = 0;
desc.plus = 1; desc.plus = 1;
for(;(page = find_get_page(&dir->i_data, desc.page_index)); desc.page_index++) { for(;(page = find_get_page(dir->i_mapping, desc.page_index)); desc.page_index++) {
res = -EIO; res = -EIO;
if (PageUptodate(page)) { if (PageUptodate(page)) {
......
...@@ -420,9 +420,9 @@ nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy) ...@@ -420,9 +420,9 @@ nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy)
kunmap(*page); kunmap(*page);
return nr; return nr;
short_pkt: short_pkt:
kunmap(*page);
printk(KERN_NOTICE "NFS: short packet in readdir reply!\n"); printk(KERN_NOTICE "NFS: short packet in readdir reply!\n");
entry[0] = entry[1] = 0; entry[0] = entry[1] = 0;
kunmap(*page);
return nr; return nr;
err_unmap: err_unmap:
kunmap(*page); kunmap(*page);
......
...@@ -574,10 +574,10 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res) ...@@ -574,10 +574,10 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res)
kunmap(*page); kunmap(*page);
return nr; return nr;
short_pkt: short_pkt:
kunmap(*page);
printk(KERN_NOTICE "NFS: short packet in readdir reply!\n"); printk(KERN_NOTICE "NFS: short packet in readdir reply!\n");
/* truncate listing */ /* truncate listing */
entry[0] = entry[1] = 0; entry[0] = entry[1] = 0;
kunmap(*page);
return nr; return nr;
err_unmap: err_unmap:
kunmap(*page); kunmap(*page);
......
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