}
nfs_pageio_complete(&desc);
- while (!list_empty(&failed)) {
- nfs_release_request(req);
+ while (!list_empty(&failed))
nfs_unlock_and_release_request(req);
- }
if (put_dreq(dreq))
nfs_direct_write_complete(dreq, dreq->inode);
nfs_list_remove_request(req);
if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES) {
/* Note the rewrite will go through mds */
+ kref_get(&req->wb_kref);
nfs_mark_request_commit(req, NULL, &cinfo);
- } else
- nfs_release_request(req);
+ }
nfs_unlock_and_release_request(req);
}
break;
}
nfs_lock_request(req);
- kref_get(&req->wb_kref);
req->wb_index = pos >> PAGE_SHIFT;
req->wb_offset = pos & ~PAGE_MASK;
if (!nfs_pageio_add_request(desc, req)) {
result = desc->pg_error;
nfs_unlock_and_release_request(req);
- nfs_release_request(req);
break;
}
pgbase = 0;
switch (bit) {
case NFS_IOHDR_NEED_RESCHED:
case NFS_IOHDR_NEED_COMMIT:
+ kref_get(&req->wb_kref);
nfs_mark_request_commit(req, hdr->lseg, &cinfo);
- break;
- default:
- nfs_release_request(req);
}
nfs_unlock_and_release_request(req);
}
while (!list_empty(head)) {
req = nfs_list_entry(head->next);
nfs_list_remove_request(req);
- nfs_release_request(req);
nfs_unlock_and_release_request(req);
}
}