}
/**
- * nfs_unlock_request - Unlock request and wake up sleepers.
+ * nfs_unlock_request_dont_release - Unlock request and wake up sleepers.
* @req:
*/
-void nfs_unlock_request(struct nfs_page *req)
+void nfs_unlock_request_dont_release(struct nfs_page *req)
{
if (!NFS_WBACK_BUSY(req)) {
printk(KERN_ERR "NFS: Invalid unlock attempted\n");
clear_bit(PG_BUSY, &req->wb_flags);
smp_mb__after_clear_bit();
wake_up_bit(&req->wb_flags, PG_BUSY);
+}
+
+/**
+ * nfs_unlock_request - Unlock request and release the nfs_page
+ */
+void nfs_unlock_request(struct nfs_page *req)
+{
+ nfs_unlock_request_dont_release(req);
nfs_release_request(req);
}
remove_req:
nfs_inode_remove_request(req);
next:
- nfs_unlock_request(req);
+ nfs_unlock_request_dont_release(req);
nfs_end_page_writeback(page);
+ nfs_release_request(req);
}
out:
hdr->release(hdr);
struct page *page = req->wb_page;
nfs_mark_request_dirty(req);
- nfs_unlock_request(req);
+ nfs_unlock_request_dont_release(req);
nfs_end_page_writeback(page);
+ nfs_release_request(req);
}
static void nfs_async_write_error(struct list_head *head)
struct nfs_page *req);
extern int nfs_wait_on_request(struct nfs_page *);
extern void nfs_unlock_request(struct nfs_page *req);
+extern void nfs_unlock_request_dont_release(struct nfs_page *req);
/*
* Lock the page of an asynchronous request without getting a new reference