diff options
| author | Patrick McHardy <kaber@trash.net> | 2010-04-20 16:02:01 +0200 | 
|---|---|---|
| committer | Patrick McHardy <kaber@trash.net> | 2010-04-20 16:02:01 +0200 | 
| commit | 62910554656cdcd6b6f84a5154c4155aae4ca231 (patch) | |
| tree | dcf14004f6fd2ef7154362ff948bfeba0f3ea92d /fs/nfs/pagelist.c | |
| parent | 22265a5c3c103cf8c50be62e6c90d045eb649e6d (diff) | |
| parent | ab9304717f7624c41927f442e6b6d418b2d8b3e4 (diff) | |
| download | olio-linux-3.10-62910554656cdcd6b6f84a5154c4155aae4ca231.tar.xz olio-linux-3.10-62910554656cdcd6b6f84a5154c4155aae4ca231.zip  | |
Merge branch 'master' of /repos/git/net-next-2.6
Conflicts:
	Documentation/feature-removal-schedule.txt
	net/ipv6/netfilter/ip6t_REJECT.c
	net/netfilter/xt_limit.c
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'fs/nfs/pagelist.c')
| -rw-r--r-- | fs/nfs/pagelist.c | 23 | 
1 files changed, 13 insertions, 10 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index a12c45b65dd..29d9d36cd5f 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -112,12 +112,10 @@ void nfs_unlock_request(struct nfs_page *req)   */  int nfs_set_page_tag_locked(struct nfs_page *req)  { -	struct nfs_inode *nfsi = NFS_I(req->wb_context->path.dentry->d_inode); -  	if (!nfs_lock_request_dontget(req))  		return 0;  	if (req->wb_page != NULL) -		radix_tree_tag_set(&nfsi->nfs_page_tree, req->wb_index, NFS_PAGE_TAG_LOCKED); +		radix_tree_tag_set(&NFS_I(req->wb_context->path.dentry->d_inode)->nfs_page_tree, req->wb_index, NFS_PAGE_TAG_LOCKED);  	return 1;  } @@ -126,10 +124,10 @@ int nfs_set_page_tag_locked(struct nfs_page *req)   */  void nfs_clear_page_tag_locked(struct nfs_page *req)  { -	struct inode *inode = req->wb_context->path.dentry->d_inode; -	struct nfs_inode *nfsi = NFS_I(inode); -  	if (req->wb_page != NULL) { +		struct inode *inode = req->wb_context->path.dentry->d_inode; +		struct nfs_inode *nfsi = NFS_I(inode); +  		spin_lock(&inode->i_lock);  		radix_tree_tag_clear(&nfsi->nfs_page_tree, req->wb_index, NFS_PAGE_TAG_LOCKED);  		nfs_unlock_request(req); @@ -142,16 +140,22 @@ void nfs_clear_page_tag_locked(struct nfs_page *req)   * nfs_clear_request - Free up all resources allocated to the request   * @req:   * - * Release page resources associated with a write request after it - * has completed. + * Release page and open context resources associated with a read/write + * request after it has completed.   */  void nfs_clear_request(struct nfs_page *req)  {  	struct page *page = req->wb_page; +	struct nfs_open_context *ctx = req->wb_context; +  	if (page != NULL) {  		page_cache_release(page);  		req->wb_page = NULL;  	} +	if (ctx != NULL) { +		put_nfs_open_context(ctx); +		req->wb_context = NULL; +	}  } @@ -165,9 +169,8 @@ static void nfs_free_request(struct kref *kref)  {  	struct nfs_page *req = container_of(kref, struct nfs_page, wb_kref); -	/* Release struct file or cached credential */ +	/* Release struct file and open context */  	nfs_clear_request(req); -	put_nfs_open_context(req->wb_context);  	nfs_page_free(req);  }  |