patch-2.1.130 linux/fs/nfs/write.c

Next file: linux/fs/proc/array.c
Previous file: linux/fs/nfs/file.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.129/linux/fs/nfs/write.c linux/fs/nfs/write.c
@@ -210,27 +210,6 @@
 }
 
 /*
- * Find any requests for the specified dentry.
- */
-int
-nfs_find_dentry_request(struct inode *inode, struct dentry *dentry)
-{
-	struct nfs_wreq	*head, *req;
-	int found = 0;
-
-	req = head = NFS_WRITEBACK(inode);
-	while (req != NULL) {
-		if (req->wb_dentry == dentry && !WB_CANCELLED(req)) {
-			found = 1;
-			break;
-		}
-		if ((req = WB_NEXT(req)) == head)
-			break;
-	}
-	return found;
-}
-
-/*
  * Find and release all failed requests for this inode.
  */
 int
@@ -477,9 +456,10 @@
 
 	/*
 	 * Ok, there's another user of this page with the new request..
-	 * The IO completion will then free the page.
+	 * The IO completion will then free the page and the dentry.
 	 */
 	atomic_inc(&page->count);
+	dget(dentry);
 
 	/* Schedule request */
 	synchronous = schedule_write_request(req, sync);
@@ -767,6 +747,7 @@
 		clear_bit(PG_uptodate, &page->flags);
 
 	__free_page(page);
+	dput(req->wb_dentry);
 
 	wake_up(&req->wb_wait);
 	

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov