Lines Matching refs:vcp
60 struct venus_comm *vcp = (struct venus_comm *) file->private_data; in coda_psdev_poll() local
63 poll_wait(file, &vcp->vc_waitq, wait); in coda_psdev_poll()
64 mutex_lock(&vcp->vc_mutex); in coda_psdev_poll()
65 if (!list_empty(&vcp->vc_pending)) in coda_psdev_poll()
67 mutex_unlock(&vcp->vc_mutex); in coda_psdev_poll()
94 struct venus_comm *vcp = (struct venus_comm *) file->private_data; in coda_psdev_write() local
137 error = coda_downcall(vcp, hdr.opcode, dcbuf, nbytes); in coda_psdev_write()
151 mutex_lock(&vcp->vc_mutex); in coda_psdev_write()
152 list_for_each(lh, &vcp->vc_processing) { in coda_psdev_write()
160 mutex_unlock(&vcp->vc_mutex); in coda_psdev_write()
212 struct venus_comm *vcp = (struct venus_comm *) file->private_data; in coda_psdev_read() local
219 mutex_lock(&vcp->vc_mutex); in coda_psdev_read()
221 add_wait_queue(&vcp->vc_waitq, &wait); in coda_psdev_read()
224 while (list_empty(&vcp->vc_pending)) { in coda_psdev_read()
233 mutex_unlock(&vcp->vc_mutex); in coda_psdev_read()
235 mutex_lock(&vcp->vc_mutex); in coda_psdev_read()
239 remove_wait_queue(&vcp->vc_waitq, &wait); in coda_psdev_read()
244 req = list_entry(vcp->vc_pending.next, struct upc_req,uc_chain); in coda_psdev_read()
261 list_add_tail(&(req->uc_chain), &vcp->vc_processing); in coda_psdev_read()
268 mutex_unlock(&vcp->vc_mutex); in coda_psdev_read()
274 struct venus_comm *vcp; in coda_psdev_open() local
288 vcp = &coda_comms[idx]; in coda_psdev_open()
289 mutex_lock(&vcp->vc_mutex); in coda_psdev_open()
291 if (!vcp->vc_inuse) { in coda_psdev_open()
292 vcp->vc_inuse++; in coda_psdev_open()
294 INIT_LIST_HEAD(&vcp->vc_pending); in coda_psdev_open()
295 INIT_LIST_HEAD(&vcp->vc_processing); in coda_psdev_open()
296 init_waitqueue_head(&vcp->vc_waitq); in coda_psdev_open()
297 vcp->vc_sb = NULL; in coda_psdev_open()
298 vcp->vc_seq = 0; in coda_psdev_open()
300 file->private_data = vcp; in coda_psdev_open()
304 mutex_unlock(&vcp->vc_mutex); in coda_psdev_open()
311 struct venus_comm *vcp = (struct venus_comm *) file->private_data; in coda_psdev_release() local
314 if (!vcp || !vcp->vc_inuse ) { in coda_psdev_release()
319 mutex_lock(&vcp->vc_mutex); in coda_psdev_release()
322 list_for_each_entry_safe(req, tmp, &vcp->vc_pending, uc_chain) { in coda_psdev_release()
335 list_for_each_entry_safe(req, tmp, &vcp->vc_processing, uc_chain) { in coda_psdev_release()
343 vcp->vc_inuse--; in coda_psdev_release()
344 mutex_unlock(&vcp->vc_mutex); in coda_psdev_release()