Lines Matching defs:req

116  * If the request is synchronous the req's refcnt is incremented
152 * v scan not req'd, error, |
460 vscan_req_t *req;
487 if ((req = vscan_svc_reql_insert(vp)) == NULL) {
500 ++(req->vsr_refcnt);
502 while ((time_left > 0) && (req->vsr_state != VS_SVC_REQ_COMPLETE)) {
504 time_left = cv_reltimedwait_sig(&(req->vsr_cv),
510 vp->v_path, req->vsr_seqnum);
511 DTRACE_PROBE1(vscan__scan__timeout, vscan_req_t *, req);
514 ASSERT(req->vsr_magic == VS_REQ_MAGIC);
517 else if (req->vsr_idx == 0)
520 access = vscan_svc_nodes[req->vsr_idx].vsn_access;
522 if ((--req->vsr_refcnt) == 0)
523 vscan_svc_delete_req(req);
539 vscan_req_t *req, *next;
561 req = vscan_svc_reql_next;
563 while (req != NULL) {
564 ASSERT(req->vsr_magic == VS_REQ_MAGIC);
565 next = list_next(&vscan_svc_reql, req);
568 vscan_svc_scan_complete(req);
571 if (vscan_svc_insert_req(req) == -1)
577 (void *)req, TQ_SLEEP);
580 req->vsr_state = VS_SVC_REQ_QUEUED;
582 req = next;
585 vscan_svc_reql_next = req;
604 vscan_req_t *req;
608 req = (vscan_req_t *)data;
609 ASSERT(req->vsr_magic == VS_REQ_MAGIC);
610 vscan_svc_do_scan(req);
611 if (req->vsr_state != VS_SVC_REQ_SCANNING)
612 vscan_svc_scan_complete(req);
629 vscan_svc_do_scan(vscan_req_t *req)
637 idx = req->vsr_idx;
640 req->vsr_state = VS_SVC_REQ_IN_PROGRESS;
650 req->vsr_vp->v_path);
671 if (req->vsr_state == VS_SVC_REQ_IN_PROGRESS)
672 req->vsr_state = VS_SVC_REQ_SCANNING;
689 vscan_req_t *req;
695 req = node->vsn_req;
699 scan_req->vsr_seqnum = req->vsr_seqnum;
700 (void) strncpy(scan_req->vsr_path, req->vsr_vp->v_path, MAXPATHLEN);
716 vscan_svc_scan_complete(vscan_req_t *req)
719 ASSERT(req != NULL);
721 req->vsr_state = VS_SVC_REQ_COMPLETE;
723 if ((--req->vsr_refcnt) == 0)
724 vscan_svc_delete_req(req);
726 cv_broadcast(&(req->vsr_cv));
734 vscan_svc_delete_req(vscan_req_t *req)
739 ASSERT(req != NULL);
740 ASSERT(req->vsr_refcnt == 0);
741 ASSERT(req->vsr_state == VS_SVC_REQ_COMPLETE);
743 if ((idx = req->vsr_idx) != 0)
746 vscan_svc_reql_remove(req);
763 vscan_req_t *req;
770 if ((req = node->vsn_req) == NULL) {
775 ASSERT(req->vsr_magic == VS_REQ_MAGIC);
777 if (scan_rsp->vsr_seqnum != req->vsr_seqnum) {
806 vscan_req_t *req;
811 if ((req = vscan_svc_nodes[idx].vsn_req) == NULL)
814 ASSERT(req->vsr_magic == VS_REQ_MAGIC);
816 if (req->vsr_state == VS_SVC_REQ_SCANNING) {
817 DTRACE_PROBE1(vscan__abort, vscan_req_t *, req);
819 vscan_svc_scan_complete(req);
1234 vscan_svc_insert_req(vscan_req_t *req)
1246 req->vsr_idx = idx;
1250 node->vsn_req = req;
1286 vscan_req_t *req;
1289 req = list_head(&vscan_svc_reql);
1291 while (req != NULL) {
1292 ASSERT(req->vsr_magic == VS_REQ_MAGIC);
1293 if ((req->vsr_vp == vp) &&
1294 (req->vsr_state != VS_SVC_REQ_COMPLETE))
1297 req = list_next(&vscan_svc_reql, req);
1300 return (req);
1310 vscan_req_t *req;
1315 if ((req = vscan_svc_reql_find(vp)) != NULL)
1316 return (req);
1325 req = kmem_zalloc(sizeof (vscan_req_t), KM_SLEEP);
1327 req->vsr_magic = VS_REQ_MAGIC;
1330 req->vsr_seqnum = ++vscan_svc_seqnum;
1331 req->vsr_vp = vp;
1332 req->vsr_refcnt = 1; /* decremented in vscan_svc_scan_complete */
1333 req->vsr_state = VS_SVC_REQ_INIT;
1334 cv_init(&(req->vsr_cv), NULL, CV_DEFAULT, NULL);
1336 list_insert_tail(&vscan_svc_reql, req);
1338 vscan_svc_reql_next = req;
1345 return (req);
1353 vscan_svc_reql_remove(vscan_req_t *req)
1356 ASSERT(req->vsr_magic == VS_REQ_MAGIC);
1358 if (vscan_svc_reql_next == req)
1359 vscan_svc_reql_next = list_next(&vscan_svc_reql, req);
1361 list_remove(&vscan_svc_reql, req);
1362 cv_destroy(&(req->vsr_cv));
1363 VN_RELE(req->vsr_vp);
1365 kmem_free(req, sizeof (vscan_req_t));