Lines Matching refs:req
270 struct p9_req_t *req = kmem_cache_alloc(p9_req_cache, GFP_NOFS);
274 if (!req)
277 if (p9_fcall_init(c, &req->tc, alloc_msize))
279 if (p9_fcall_init(c, &req->rc, alloc_msize))
282 p9pdu_reset(&req->tc);
283 p9pdu_reset(&req->rc);
284 req->t_err = 0;
285 req->status = REQ_STATUS_ALLOC;
286 init_waitqueue_head(&req->wq);
287 INIT_LIST_HEAD(&req->req_list);
292 tag = idr_alloc(&c->reqs, req, P9_NOTAG, P9_NOTAG + 1,
295 tag = idr_alloc(&c->reqs, req, 0, P9_NOTAG, GFP_NOWAIT);
296 req->tc.tag = tag;
312 refcount_set(&req->refcount.refcount, 2);
314 return req;
317 p9_fcall_fini(&req->tc);
318 p9_fcall_fini(&req->rc);
320 kmem_cache_free(p9_req_cache, req);
334 struct p9_req_t *req;
338 req = idr_find(&c->reqs, tag);
339 if (req) {
340 /* We have to be careful with the req found under rcu_read_lock
345 if (!p9_req_try_get(req))
347 if (req->tc.tag != tag) {
348 p9_req_put(req);
354 return req;
370 p9_debug(P9_DEBUG_MUX, "clnt %p req %p tag: %d\n", c, r, tag);
400 struct p9_req_t *req;
404 idr_for_each_entry(&c->reqs, req, id) {
406 if (p9_tag_remove(c, req) == 0)
408 req->tc.tag);
416 * req: request received
419 void p9_client_cb(struct p9_client *c, struct p9_req_t *req, int status)
421 p9_debug(P9_DEBUG_MUX, " tag %d\n", req->tc.tag);
424 * This barrier is needed to make sure any change made to req before
428 req->status = status;
430 wake_up(&req->wq);
431 p9_debug(P9_DEBUG_MUX, "wakeup: %d\n", req->tc.tag);
432 p9_req_put(req);
489 * @req: request to parse and check for error conditions
497 static int p9_check_errors(struct p9_client *c, struct p9_req_t *req)
503 err = p9_parse_header(&req->rc, NULL, &type, NULL, 0);
504 if (req->rc.size >= c->msize) {
507 req->rc.size);
514 trace_9p_protocol_dump(c, &req->rc);
525 err = p9pdu_readf(&req->rc, c->proto_version, "s?d",
543 err = p9pdu_readf(&req->rc, c->proto_version, "d", &ecode);
562 * @req: request to parse and check for error conditions
571 static int p9_check_zc_errors(struct p9_client *c, struct p9_req_t *req,
579 err = p9_parse_header(&req->rc, NULL, &type, NULL, 0);
584 trace_9p_protocol_dump(c, &req->rc);
599 len = req->rc.size - req->rc.offset;
605 ename = &req->rc.sdata[req->rc.offset];
615 err = p9pdu_readf(&req->rc, c->proto_version, "s?d",
631 err = p9pdu_readf(&req->rc, c->proto_version, "d", &ecode);
660 struct p9_req_t *req;
670 req = p9_client_rpc(c, P9_TFLUSH, "w", oldtag);
671 if (IS_ERR(req))
672 return PTR_ERR(req);
683 p9_tag_remove(c, req);
692 struct p9_req_t *req;
704 req = p9_tag_alloc(c, type, req_size);
705 if (IS_ERR(req))
706 return req;
709 p9pdu_prepare(&req->tc, req->tc.tag, type);
710 err = p9pdu_vwritef(&req->tc, c->proto_version, fmt, ap);
713 p9pdu_finalize(c, &req->tc);
714 trace_9p_client_req(c, type, req->tc.tag);
715 return req;
717 p9_tag_remove(c, req);
719 p9_req_put(req);
738 struct p9_req_t *req;
741 req = p9_client_prepare_req(c, type, c->msize, fmt, ap);
743 if (IS_ERR(req))
744 return req;
752 err = c->trans_mod->request(c, req);
755 p9_req_put(req);
762 err = wait_event_killable(req->wq, req->status >= REQ_STATUS_RCVD);
765 * Make sure our req is coherent with regard to updates in other
777 if (req->status == REQ_STATUS_ERROR) {
778 p9_debug(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err);
779 err = req->t_err;
786 if (c->trans_mod->cancel(c, req))
787 p9_client_flush(c, req);
790 if (req->status == REQ_STATUS_RCVD)
802 err = p9_check_errors(c, req);
803 trace_9p_client_res(c, type, req->rc.tag, err);
805 return req;
807 p9_tag_remove(c, req);
833 struct p9_req_t *req;
840 req = p9_client_prepare_req(c, type, P9_ZC_HDR_SZ, fmt, ap);
842 if (IS_ERR(req))
843 return req;
851 err = c->trans_mod->zc_request(c, req, uidata, uodata,
859 if (req->status == REQ_STATUS_ERROR) {
860 p9_debug(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err);
861 err = req->t_err;
868 if (c->trans_mod->cancel(c, req))
869 p9_client_flush(c, req);
872 if (req->status == REQ_STATUS_RCVD)
884 err = p9_check_zc_errors(c, req, uidata, in_hdrlen);
885 trace_9p_client_res(c, type, req->rc.tag, err);
887 return req;
889 p9_tag_remove(c, req);
938 struct p9_req_t *req;
947 req = p9_client_rpc(c, P9_TVERSION, "ds",
951 req = p9_client_rpc(c, P9_TVERSION, "ds",
955 req = p9_client_rpc(c, P9_TVERSION, "ds",
962 if (IS_ERR(req))
963 return PTR_ERR(req);
965 err = p9pdu_readf(&req->rc, c->proto_version, "ds", &msize, &version);
968 trace_9p_protocol_dump(c, &req->rc);
997 p9_tag_remove(c, req);
1122 struct p9_req_t *req;
1136 req = p9_client_rpc(clnt, P9_TATTACH, "ddss?u", fid->fid,
1138 if (IS_ERR(req)) {
1139 err = PTR_ERR(req);
1143 err = p9pdu_readf(&req->rc, clnt->proto_version, "Q", &qid);
1145 trace_9p_protocol_dump(clnt, &req->rc);
1146 p9_tag_remove(clnt, req);
1155 p9_tag_remove(clnt, req);
1172 struct p9_req_t *req;
1193 req = p9_client_rpc(clnt, P9_TWALK, "ddT", oldfid->fid, fid->fid,
1195 if (IS_ERR(req)) {
1196 err = PTR_ERR(req);
1200 err = p9pdu_readf(&req->rc, clnt->proto_version, "R", &nwqids, &wqids);
1202 trace_9p_protocol_dump(clnt, &req->rc);
1203 p9_tag_remove(clnt, req);
1206 p9_tag_remove(clnt, req);
1246 struct p9_req_t *req;
1259 req = p9_client_rpc(clnt, P9_TLOPEN, "dd", fid->fid, mode);
1261 req = p9_client_rpc(clnt, P9_TOPEN, "db", fid->fid, mode);
1262 if (IS_ERR(req)) {
1263 err = PTR_ERR(req);
1267 err = p9pdu_readf(&req->rc, clnt->proto_version, "Qd", &qid, &iounit);
1269 trace_9p_protocol_dump(clnt, &req->rc);
1281 p9_tag_remove(clnt, req);
1292 struct p9_req_t *req;
1304 req = p9_client_rpc(clnt, P9_TLCREATE, "dsddg", ofid->fid, name, flags,
1306 if (IS_ERR(req)) {
1307 err = PTR_ERR(req);
1311 err = p9pdu_readf(&req->rc, clnt->proto_version, "Qd", qid, &iounit);
1313 trace_9p_protocol_dump(clnt, &req->rc);
1326 p9_tag_remove(clnt, req);
1337 struct p9_req_t *req;
1349 req = p9_client_rpc(clnt, P9_TCREATE, "dsdb?s", fid->fid, name, perm,
1351 if (IS_ERR(req)) {
1352 err = PTR_ERR(req);
1356 err = p9pdu_readf(&req->rc, clnt->proto_version, "Qd", &qid, &iounit);
1358 trace_9p_protocol_dump(clnt, &req->rc);
1371 p9_tag_remove(clnt, req);
1382 struct p9_req_t *req;
1388 req = p9_client_rpc(clnt, P9_TSYMLINK, "dssg", dfid->fid, name, symtgt,
1390 if (IS_ERR(req)) {
1391 err = PTR_ERR(req);
1395 err = p9pdu_readf(&req->rc, clnt->proto_version, "Q", qid);
1397 trace_9p_protocol_dump(clnt, &req->rc);
1405 p9_tag_remove(clnt, req);
1414 struct p9_req_t *req;
1419 req = p9_client_rpc(clnt, P9_TLINK, "dds", dfid->fid, oldfid->fid,
1421 if (IS_ERR(req))
1422 return PTR_ERR(req);
1425 p9_tag_remove(clnt, req);
1434 struct p9_req_t *req;
1441 req = p9_client_rpc(clnt, P9_TFSYNC, "dd", fid->fid, datasync);
1442 if (IS_ERR(req)) {
1443 err = PTR_ERR(req);
1449 p9_tag_remove(clnt, req);
1460 struct p9_req_t *req;
1476 req = p9_client_rpc(clnt, P9_TCLUNK, "d", fid->fid);
1477 if (IS_ERR(req)) {
1478 err = PTR_ERR(req);
1484 p9_tag_remove(clnt, req);
1504 struct p9_req_t *req;
1510 req = p9_client_rpc(clnt, P9_TREMOVE, "d", fid->fid);
1511 if (IS_ERR(req)) {
1512 err = PTR_ERR(req);
1518 p9_tag_remove(clnt, req);
1531 struct p9_req_t *req;
1538 req = p9_client_rpc(clnt, P9_TUNLINKAT, "dsd", dfid->fid, name, flags);
1539 if (IS_ERR(req)) {
1540 err = PTR_ERR(req);
1545 p9_tag_remove(clnt, req);
1575 struct p9_req_t *req;
1596 req = p9_client_zc_rpc(clnt, P9_TREAD, to, NULL, rsize,
1601 req = p9_client_rpc(clnt, P9_TREAD, "dqd", fid->fid, offset,
1604 if (IS_ERR(req)) {
1605 *err = PTR_ERR(req);
1609 *err = p9pdu_readf(&req->rc, clnt->proto_version,
1612 trace_9p_protocol_dump(clnt, &req->rc);
1613 p9_tag_remove(clnt, req);
1628 p9_tag_remove(clnt, req);
1634 p9_tag_remove(clnt, req);
1643 struct p9_req_t *req;
1662 req = p9_client_zc_rpc(clnt, P9_TWRITE, NULL, from, 0,
1666 req = p9_client_rpc(clnt, P9_TWRITE, "dqV", fid->fid,
1669 if (IS_ERR(req)) {
1670 *err = PTR_ERR(req);
1674 *err = p9pdu_readf(&req->rc, clnt->proto_version, "d", &count);
1676 trace_9p_protocol_dump(clnt, &req->rc);
1677 p9_tag_remove(clnt, req);
1687 p9_tag_remove(clnt, req);
1701 struct p9_req_t *req;
1712 req = p9_client_rpc(clnt, P9_TSTAT, "d", fid->fid);
1713 if (IS_ERR(req)) {
1714 err = PTR_ERR(req);
1718 err = p9pdu_readf(&req->rc, clnt->proto_version, "wS", &ignored, ret);
1720 trace_9p_protocol_dump(clnt, &req->rc);
1721 p9_tag_remove(clnt, req);
1738 p9_tag_remove(clnt, req);
1754 struct p9_req_t *req;
1765 req = p9_client_rpc(clnt, P9_TGETATTR, "dq", fid->fid, request_mask);
1766 if (IS_ERR(req)) {
1767 err = PTR_ERR(req);
1771 err = p9pdu_readf(&req->rc, clnt->proto_version, "A", ret);
1773 trace_9p_protocol_dump(clnt, &req->rc);
1774 p9_tag_remove(clnt, req);
1799 p9_tag_remove(clnt, req);
1840 struct p9_req_t *req;
1860 req = p9_client_rpc(clnt, P9_TWSTAT, "dwS", fid->fid, wst->size+2, wst);
1861 if (IS_ERR(req)) {
1862 err = PTR_ERR(req);
1868 p9_tag_remove(clnt, req);
1877 struct p9_req_t *req;
1893 req = p9_client_rpc(clnt, P9_TSETATTR, "dI", fid->fid, p9attr);
1895 if (IS_ERR(req)) {
1896 err = PTR_ERR(req);
1900 p9_tag_remove(clnt, req);
1909 struct p9_req_t *req;
1917 req = p9_client_rpc(clnt, P9_TSTATFS, "d", fid->fid);
1918 if (IS_ERR(req)) {
1919 err = PTR_ERR(req);
1923 err = p9pdu_readf(&req->rc, clnt->proto_version, "ddqqqqqqd", &sb->type,
1927 trace_9p_protocol_dump(clnt, &req->rc);
1928 p9_tag_remove(clnt, req);
1939 p9_tag_remove(clnt, req);
1949 struct p9_req_t *req;
1958 req = p9_client_rpc(clnt, P9_TRENAME, "dds", fid->fid,
1960 if (IS_ERR(req)) {
1961 err = PTR_ERR(req);
1967 p9_tag_remove(clnt, req);
1977 struct p9_req_t *req;
1987 req = p9_client_rpc(clnt, P9_TRENAMEAT, "dsds", olddirfid->fid,
1989 if (IS_ERR(req)) {
1990 err = PTR_ERR(req);
1997 p9_tag_remove(clnt, req);
2010 struct p9_req_t *req;
2025 req = p9_client_rpc(clnt, P9_TXATTRWALK, "dds",
2027 if (IS_ERR(req)) {
2028 err = PTR_ERR(req);
2031 err = p9pdu_readf(&req->rc, clnt->proto_version, "q", attr_size);
2033 trace_9p_protocol_dump(clnt, &req->rc);
2034 p9_tag_remove(clnt, req);
2037 p9_tag_remove(clnt, req);
2056 struct p9_req_t *req;
2064 req = p9_client_rpc(clnt, P9_TXATTRCREATE, "dsqd",
2066 if (IS_ERR(req)) {
2067 err = PTR_ERR(req);
2071 p9_tag_remove(clnt, req);
2081 struct p9_req_t *req;
2107 req = p9_client_zc_rpc(clnt, P9_TREADDIR, &to, NULL, rsize, 0,
2111 req = p9_client_rpc(clnt, P9_TREADDIR, "dqd", fid->fid,
2114 if (IS_ERR(req)) {
2115 err = PTR_ERR(req);
2119 err = p9pdu_readf(&req->rc, clnt->proto_version, "D", &count, &dataptr);
2121 trace_9p_protocol_dump(clnt, &req->rc);
2134 p9_tag_remove(clnt, req);
2138 p9_tag_remove(clnt, req);
2149 struct p9_req_t *req;
2155 req = p9_client_rpc(clnt, P9_TMKNOD, "dsdddg", fid->fid, name, mode,
2157 if (IS_ERR(req))
2158 return PTR_ERR(req);
2160 err = p9pdu_readf(&req->rc, clnt->proto_version, "Q", qid);
2162 trace_9p_protocol_dump(clnt, &req->rc);
2169 p9_tag_remove(clnt, req);
2180 struct p9_req_t *req;
2186 req = p9_client_rpc(clnt, P9_TMKDIR, "dsdg", fid->fid, name, mode,
2188 if (IS_ERR(req))
2189 return PTR_ERR(req);
2191 err = p9pdu_readf(&req->rc, clnt->proto_version, "Q", qid);
2193 trace_9p_protocol_dump(clnt, &req->rc);
2200 p9_tag_remove(clnt, req);
2210 struct p9_req_t *req;
2219 req = p9_client_rpc(clnt, P9_TLOCK, "dbdqqds", fid->fid, flock->type,
2223 if (IS_ERR(req))
2224 return PTR_ERR(req);
2226 err = p9pdu_readf(&req->rc, clnt->proto_version, "b", status);
2228 trace_9p_protocol_dump(clnt, &req->rc);
2233 p9_tag_remove(clnt, req);
2243 struct p9_req_t *req;
2251 req = p9_client_rpc(clnt, P9_TGETLOCK, "dbqqds", fid->fid, glock->type,
2254 if (IS_ERR(req))
2255 return PTR_ERR(req);
2257 err = p9pdu_readf(&req->rc, clnt->proto_version, "bqqds", &glock->type,
2261 trace_9p_protocol_dump(clnt, &req->rc);
2268 p9_tag_remove(clnt, req);
2277 struct p9_req_t *req;
2283 req = p9_client_rpc(clnt, P9_TREADLINK, "d", fid->fid);
2284 if (IS_ERR(req))
2285 return PTR_ERR(req);
2287 err = p9pdu_readf(&req->rc, clnt->proto_version, "s", target);
2289 trace_9p_protocol_dump(clnt, &req->rc);
2294 p9_tag_remove(clnt, req);