Lines Matching full:req
281 struct p9_req_t *req = kmem_cache_alloc(p9_req_cache, GFP_NOFS);
295 if (!req)
298 if (p9_fcall_init(c, &req->tc, alloc_tsize))
300 if (p9_fcall_init(c, &req->rc, alloc_rsize))
303 p9pdu_reset(&req->tc);
304 p9pdu_reset(&req->rc);
305 req->t_err = 0;
306 req->status = REQ_STATUS_ALLOC;
311 refcount_set(&req->refcount, 0);
312 init_waitqueue_head(&req->wq);
313 INIT_LIST_HEAD(&req->req_list);
318 tag = idr_alloc(&c->reqs, req, P9_NOTAG, P9_NOTAG + 1,
321 tag = idr_alloc(&c->reqs, req, 0, P9_NOTAG, GFP_NOWAIT);
322 req->tc.tag = tag;
338 refcount_set(&req->refcount, 2);
340 return req;
343 p9_fcall_fini(&req->tc);
344 p9_fcall_fini(&req->rc);
346 kmem_cache_free(p9_req_cache, req);
360 struct p9_req_t *req;
364 req = idr_find(&c->reqs, tag);
365 if (req) {
366 /* We have to be careful with the req found under rcu_read_lock
371 if (!p9_req_try_get(req))
373 if (req->tc.tag != tag) {
374 p9_req_put(c, req);
380 return req;
396 p9_debug(P9_DEBUG_MUX, "freeing clnt %p req %p tag: %d\n", c, r, tag);
425 struct p9_req_t *req;
429 idr_for_each_entry(&c->reqs, req, id) {
431 if (p9_req_put(c, req) == 0)
433 req->tc.tag);
441 * @req: request received
445 void p9_client_cb(struct p9_client *c, struct p9_req_t *req, int status)
447 p9_debug(P9_DEBUG_MUX, " tag %d\n", req->tc.tag);
449 /* This barrier is needed to make sure any change made to req before
453 WRITE_ONCE(req->status, status);
455 wake_up(&req->wq);
456 p9_debug(P9_DEBUG_MUX, "wakeup: %d\n", req->tc.tag);
457 p9_req_put(c, req);
514 * @req: request to parse and check for error conditions
522 static int p9_check_errors(struct p9_client *c, struct p9_req_t *req)
528 err = p9_parse_header(&req->rc, NULL, &type, NULL, 0);
529 if (req->rc.size > req->rc.capacity && !req->rc.zc) {
531 req->rc.size, req->rc.capacity, req->rc.id);
537 trace_9p_protocol_dump(c, &req->rc);
548 err = p9pdu_readf(&req->rc, c->proto_version, "s?d",
566 err = p9pdu_readf(&req->rc, c->proto_version, "d", &ecode);
599 struct p9_req_t *req;
609 req = p9_client_rpc(c, P9_TFLUSH, "w", oldtag);
610 if (IS_ERR(req))
611 return PTR_ERR(req);
621 p9_req_put(c, req);
630 struct p9_req_t *req;
644 req = p9_tag_alloc(c, type, t_size, r_size, fmt, apc);
646 if (IS_ERR(req))
647 return req;
650 p9pdu_prepare(&req->tc, req->tc.tag, type);
651 err = p9pdu_vwritef(&req->tc, c->proto_version, fmt, ap);
654 p9pdu_finalize(c, &req->tc);
655 trace_9p_client_req(c, type, req->tc.tag);
656 return req;
658 p9_req_put(c, req);
660 p9_req_put(c, req);
679 struct p9_req_t *req;
691 req = p9_client_prepare_req(c, type, tsize, rsize, fmt, ap);
693 if (IS_ERR(req))
694 return req;
696 req->tc.zc = false;
697 req->rc.zc = false;
706 err = c->trans_mod->request(c, req);
709 p9_req_put(c, req);
716 err = wait_event_killable(req->wq,
717 READ_ONCE(req->status) >= REQ_STATUS_RCVD);
719 /* Make sure our req is coherent with regard to updates in other
731 if (READ_ONCE(req->status) == REQ_STATUS_ERROR) {
732 p9_debug(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err);
733 err = req->t_err;
740 if (c->trans_mod->cancel(c, req))
741 p9_client_flush(c, req);
744 if (READ_ONCE(req->status) == REQ_STATUS_RCVD)
756 err = p9_check_errors(c, req);
757 trace_9p_client_res(c, type, req->rc.tag, err);
759 return req;
761 p9_req_put(c, req);
787 struct p9_req_t *req;
793 req = p9_client_prepare_req(c, type, P9_ZC_HDR_SZ, P9_ZC_HDR_SZ, fmt, ap);
795 if (IS_ERR(req))
796 return req;
798 req->tc.zc = true;
799 req->rc.zc = true;
808 err = c->trans_mod->zc_request(c, req, uidata, uodata,
816 if (READ_ONCE(req->status) == REQ_STATUS_ERROR) {
817 p9_debug(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err);
818 err = req->t_err;
825 if (c->trans_mod->cancel(c, req))
826 p9_client_flush(c, req);
829 if (READ_ONCE(req->status) == REQ_STATUS_RCVD)
841 err = p9_check_errors(c, req);
842 trace_9p_client_res(c, type, req->rc.tag, err);
844 return req;
846 p9_req_put(c, req);
913 struct p9_req_t *req;
922 req = p9_client_rpc(c, P9_TVERSION, "ds",
926 req = p9_client_rpc(c, P9_TVERSION, "ds",
930 req = p9_client_rpc(c, P9_TVERSION, "ds",
937 if (IS_ERR(req))
938 return PTR_ERR(req);
940 err = p9pdu_readf(&req->rc, c->proto_version, "ds", &msize, &version);
943 trace_9p_protocol_dump(c, &req->rc);
972 p9_req_put(c, req);
1112 struct p9_req_t *req;
1125 req = p9_client_rpc(clnt, P9_TATTACH, "ddss?u", fid->fid,
1127 if (IS_ERR(req)) {
1128 err = PTR_ERR(req);
1132 err = p9pdu_readf(&req->rc, clnt->proto_version, "Q", &qid);
1134 trace_9p_protocol_dump(clnt, &req->rc);
1135 p9_req_put(clnt, req);
1144 p9_req_put(clnt, req);
1161 struct p9_req_t *req;
1180 req = p9_client_rpc(clnt, P9_TWALK, "ddT", oldfid->fid, fid->fid,
1182 if (IS_ERR(req)) {
1183 err = PTR_ERR(req);
1187 err = p9pdu_readf(&req->rc, clnt->proto_version, "R", &nwqids, &wqids);
1189 trace_9p_protocol_dump(clnt, &req->rc);
1190 p9_req_put(clnt, req);
1193 p9_req_put(clnt, req);
1233 struct p9_req_t *req;
1245 req = p9_client_rpc(clnt, P9_TLOPEN, "dd", fid->fid, mode & P9L_MODE_MASK);
1247 req = p9_client_rpc(clnt, P9_TOPEN, "db", fid->fid, mode & P9L_MODE_MASK);
1248 if (IS_ERR(req)) {
1249 err = PTR_ERR(req);
1253 err = p9pdu_readf(&req->rc, clnt->proto_version, "Qd", &qid, &iounit);
1255 trace_9p_protocol_dump(clnt, &req->rc);
1268 p9_req_put(clnt, req);
1279 struct p9_req_t *req;
1291 req = p9_client_rpc(clnt, P9_TLCREATE, "dsddg", ofid->fid, name, flags,
1293 if (IS_ERR(req)) {
1294 err = PTR_ERR(req);
1298 err = p9pdu_readf(&req->rc, clnt->proto_version, "Qd", qid, &iounit);
1300 trace_9p_protocol_dump(clnt, &req->rc);
1312 p9_req_put(clnt, req);
1323 struct p9_req_t *req;
1334 req = p9_client_rpc(clnt, P9_TCREATE, "dsdb?s", fid->fid, name, perm,
1336 if (IS_ERR(req)) {
1337 err = PTR_ERR(req);
1341 err = p9pdu_readf(&req->rc, clnt->proto_version, "Qd", &qid, &iounit);
1343 trace_9p_protocol_dump(clnt, &req->rc);
1355 p9_req_put(clnt, req);
1366 struct p9_req_t *req;
1372 req = p9_client_rpc(clnt, P9_TSYMLINK, "dssg", dfid->fid, name, symtgt,
1374 if (IS_ERR(req)) {
1375 err = PTR_ERR(req);
1379 err = p9pdu_readf(&req->rc, clnt->proto_version, "Q", qid);
1381 trace_9p_protocol_dump(clnt, &req->rc);
1389 p9_req_put(clnt, req);
1398 struct p9_req_t *req;
1403 req = p9_client_rpc(clnt, P9_TLINK, "dds", dfid->fid, oldfid->fid,
1405 if (IS_ERR(req))
1406 return PTR_ERR(req);
1409 p9_req_put(clnt, req);
1418 struct p9_req_t *req;
1424 req = p9_client_rpc(clnt, P9_TFSYNC, "dd", fid->fid, datasync);
1425 if (IS_ERR(req)) {
1426 err = PTR_ERR(req);
1432 p9_req_put(clnt, req);
1443 struct p9_req_t *req;
1451 req = p9_client_rpc(clnt, P9_TCLUNK, "d", fid->fid);
1452 if (IS_ERR(req)) {
1453 err = PTR_ERR(req);
1459 p9_req_put(clnt, req);
1479 struct p9_req_t *req;
1484 req = p9_client_rpc(clnt, P9_TREMOVE, "d", fid->fid);
1485 if (IS_ERR(req)) {
1486 err = PTR_ERR(req);
1492 p9_req_put(clnt, req);
1505 struct p9_req_t *req;
1512 req = p9_client_rpc(clnt, P9_TUNLINKAT, "dsd", dfid->fid, name, flags);
1513 if (IS_ERR(req)) {
1514 err = PTR_ERR(req);
1519 p9_req_put(clnt, req);
1549 struct p9_req_t *req;
1571 req = p9_client_zc_rpc(clnt, P9_TREAD, to, NULL, rsize,
1576 req = p9_client_rpc(clnt, P9_TREAD, "dqd", fid->fid, offset,
1579 if (IS_ERR(req)) {
1580 *err = PTR_ERR(req);
1586 *err = p9pdu_readf(&req->rc, clnt->proto_version,
1591 trace_9p_protocol_dump(clnt, &req->rc);
1592 p9_req_put(clnt, req);
1598 p9_req_put(clnt, req);
1609 p9_req_put(clnt, req);
1615 p9_req_put(clnt, req);
1624 struct p9_req_t *req;
1644 req = p9_client_zc_rpc(clnt, P9_TWRITE, NULL, from, 0,
1648 req = p9_client_rpc(clnt, P9_TWRITE, "dqV", fid->fid,
1651 if (IS_ERR(req)) {
1653 *err = PTR_ERR(req);
1657 *err = p9pdu_readf(&req->rc, clnt->proto_version, "d", &written);
1660 trace_9p_protocol_dump(clnt, &req->rc);
1661 p9_req_put(clnt, req);
1668 p9_req_put(clnt, req);
1674 p9_req_put(clnt, req);
1689 struct p9_req_t *req;
1699 req = p9_client_zc_rpc(clnt, P9_TWRITE, NULL, &subreq->io_iter,
1703 req = p9_client_rpc(clnt, P9_TWRITE, "dqV", fid->fid,
1706 if (IS_ERR(req)) {
1707 netfs_write_subrequest_terminated(subreq, PTR_ERR(req));
1711 err = p9pdu_readf(&req->rc, clnt->proto_version, "d", &written);
1713 trace_9p_protocol_dump(clnt, &req->rc);
1714 p9_req_put(clnt, req);
1726 p9_req_put(clnt, req);
1736 struct p9_req_t *req;
1747 req = p9_client_rpc(clnt, P9_TSTAT, "d", fid->fid);
1748 if (IS_ERR(req)) {
1749 err = PTR_ERR(req);
1753 err = p9pdu_readf(&req->rc, clnt->proto_version, "wS", &ignored, ret);
1755 trace_9p_protocol_dump(clnt, &req->rc);
1756 p9_req_put(clnt, req);
1773 p9_req_put(clnt, req);
1788 struct p9_req_t *req;
1799 req = p9_client_rpc(clnt, P9_TGETATTR, "dq", fid->fid, request_mask);
1800 if (IS_ERR(req)) {
1801 err = PTR_ERR(req);
1805 err = p9pdu_readf(&req->rc, clnt->proto_version, "A", ret);
1807 trace_9p_protocol_dump(clnt, &req->rc);
1808 p9_req_put(clnt, req);
1834 p9_req_put(clnt, req);
1876 struct p9_req_t *req;
1896 req = p9_client_rpc(clnt, P9_TWSTAT, "dwS",
1898 if (IS_ERR(req)) {
1899 err = PTR_ERR(req);
1905 p9_req_put(clnt, req);
1914 struct p9_req_t *req;
1929 req = p9_client_rpc(clnt, P9_TSETATTR, "dI", fid->fid, p9attr);
1931 if (IS_ERR(req)) {
1932 err = PTR_ERR(req);
1936 p9_req_put(clnt, req);
1945 struct p9_req_t *req;
1952 req = p9_client_rpc(clnt, P9_TSTATFS, "d", fid->fid);
1953 if (IS_ERR(req)) {
1954 err = PTR_ERR(req);
1958 err = p9pdu_readf(&req->rc, clnt->proto_version, "ddqqqqqqd", &sb->type,
1962 trace_9p_protocol_dump(clnt, &req->rc);
1963 p9_req_put(clnt, req);
1972 p9_req_put(clnt, req);
1982 struct p9_req_t *req;
1990 req = p9_client_rpc(clnt, P9_TRENAME, "dds", fid->fid,
1992 if (IS_ERR(req)) {
1993 err = PTR_ERR(req);
1999 p9_req_put(clnt, req);
2009 struct p9_req_t *req;
2018 req = p9_client_rpc(clnt, P9_TRENAMEAT, "dsds", olddirfid->fid,
2020 if (IS_ERR(req)) {
2021 err = PTR_ERR(req);
2028 p9_req_put(clnt, req);
2040 struct p9_req_t *req;
2054 req = p9_client_rpc(clnt, P9_TXATTRWALK, "dds",
2056 if (IS_ERR(req)) {
2057 err = PTR_ERR(req);
2060 err = p9pdu_readf(&req->rc, clnt->proto_version, "q", attr_size);
2062 trace_9p_protocol_dump(clnt, &req->rc);
2063 p9_req_put(clnt, req);
2066 p9_req_put(clnt, req);
2085 struct p9_req_t *req;
2092 req = p9_client_rpc(clnt, P9_TXATTRCREATE, "dsqd",
2094 if (IS_ERR(req)) {
2095 err = PTR_ERR(req);
2099 p9_req_put(clnt, req);
2110 struct p9_req_t *req;
2134 req = p9_client_zc_rpc(clnt, P9_TREADDIR, &to, NULL, rsize, 0,
2138 req = p9_client_rpc(clnt, P9_TREADDIR, "dqd", fid->fid,
2141 if (IS_ERR(req)) {
2142 err = PTR_ERR(req);
2146 err = p9pdu_readf(&req->rc, clnt->proto_version, "D", &count, &dataptr);
2148 trace_9p_protocol_dump(clnt, &req->rc);
2162 p9_req_put(clnt, req);
2166 p9_req_put(clnt, req);
2177 struct p9_req_t *req;
2183 req = p9_client_rpc(clnt, P9_TMKNOD, "dsdddg", fid->fid, name, mode,
2185 if (IS_ERR(req))
2186 return PTR_ERR(req);
2188 err = p9pdu_readf(&req->rc, clnt->proto_version, "Q", qid);
2190 trace_9p_protocol_dump(clnt, &req->rc);
2197 p9_req_put(clnt, req);
2207 struct p9_req_t *req;
2212 req = p9_client_rpc(clnt, P9_TMKDIR, "dsdg",
2214 if (IS_ERR(req))
2215 return PTR_ERR(req);
2217 err = p9pdu_readf(&req->rc, clnt->proto_version, "Q", qid);
2219 trace_9p_protocol_dump(clnt, &req->rc);
2226 p9_req_put(clnt, req);
2235 struct p9_req_t *req;
2243 req = p9_client_rpc(clnt, P9_TLOCK, "dbdqqds", fid->fid, flock->type,
2247 if (IS_ERR(req))
2248 return PTR_ERR(req);
2250 err = p9pdu_readf(&req->rc, clnt->proto_version, "b", status);
2252 trace_9p_protocol_dump(clnt, &req->rc);
2257 p9_req_put(clnt, req);
2266 struct p9_req_t *req;
2274 req = p9_client_rpc(clnt, P9_TGETLOCK, "dbqqds", fid->fid,
2278 if (IS_ERR(req))
2279 return PTR_ERR(req);
2281 err = p9pdu_readf(&req->rc, clnt->proto_version, "bqqds", &glock->type,
2285 trace_9p_protocol_dump(clnt, &req->rc);
2293 p9_req_put(clnt, req);
2302 struct p9_req_t *req;
2307 req = p9_client_rpc(clnt, P9_TREADLINK, "d", fid->fid);
2308 if (IS_ERR(req))
2309 return PTR_ERR(req);
2311 err = p9pdu_readf(&req->rc, clnt->proto_version, "s", target);
2313 trace_9p_protocol_dump(clnt, &req->rc);
2318 p9_req_put(clnt, req);