Lines Matching refs:req

434 	struct ceph_mon_generic_request *req;  in __lookup_generic_req()  local
438 req = rb_entry(n, struct ceph_mon_generic_request, node); in __lookup_generic_req()
439 if (tid < req->tid) in __lookup_generic_req()
441 else if (tid > req->tid) in __lookup_generic_req()
444 return req; in __lookup_generic_req()
454 struct ceph_mon_generic_request *req = NULL; in __insert_generic_request() local
458 req = rb_entry(parent, struct ceph_mon_generic_request, node); in __insert_generic_request()
459 if (new->tid < req->tid) in __insert_generic_request()
461 else if (new->tid > req->tid) in __insert_generic_request()
473 struct ceph_mon_generic_request *req = in release_generic_request() local
476 if (req->reply) in release_generic_request()
477 ceph_msg_put(req->reply); in release_generic_request()
478 if (req->request) in release_generic_request()
479 ceph_msg_put(req->request); in release_generic_request()
481 kfree(req); in release_generic_request()
484 static void put_generic_request(struct ceph_mon_generic_request *req) in put_generic_request() argument
486 kref_put(&req->kref, release_generic_request); in put_generic_request()
489 static void get_generic_request(struct ceph_mon_generic_request *req) in get_generic_request() argument
491 kref_get(&req->kref); in get_generic_request()
499 struct ceph_mon_generic_request *req; in get_generic_reply() local
504 req = __lookup_generic_req(monc, tid); in get_generic_reply()
505 if (!req) { in get_generic_reply()
510 dout("get_generic_reply %lld got %p\n", tid, req->reply); in get_generic_reply()
512 m = ceph_msg_get(req->reply); in get_generic_reply()
524 struct ceph_mon_generic_request *req) in __do_generic_request() argument
529 req->tid = tid != 0 ? tid : ++monc->last_tid; in __do_generic_request()
530 req->request->hdr.tid = cpu_to_le64(req->tid); in __do_generic_request()
531 __insert_generic_request(monc, req); in __do_generic_request()
533 ceph_con_send(&monc->con, ceph_msg_get(req->request)); in __do_generic_request()
536 err = wait_for_completion_interruptible(&req->completion); in __do_generic_request()
539 rb_erase(&req->node, &monc->generic_request_tree); in __do_generic_request()
543 err = req->result; in __do_generic_request()
548 struct ceph_mon_generic_request *req) in do_generic_request() argument
553 err = __do_generic_request(monc, 0, req); in do_generic_request()
565 struct ceph_mon_generic_request *req; in handle_statfs_reply() local
574 req = __lookup_generic_req(monc, tid); in handle_statfs_reply()
575 if (req) { in handle_statfs_reply()
576 *(struct ceph_statfs *)req->buf = reply->st; in handle_statfs_reply()
577 req->result = 0; in handle_statfs_reply()
578 get_generic_request(req); in handle_statfs_reply()
581 if (req) { in handle_statfs_reply()
582 complete_all(&req->completion); in handle_statfs_reply()
583 put_generic_request(req); in handle_statfs_reply()
597 struct ceph_mon_generic_request *req; in ceph_monc_do_statfs() local
601 req = kzalloc(sizeof(*req), GFP_NOFS); in ceph_monc_do_statfs()
602 if (!req) in ceph_monc_do_statfs()
605 kref_init(&req->kref); in ceph_monc_do_statfs()
606 req->buf = buf; in ceph_monc_do_statfs()
607 init_completion(&req->completion); in ceph_monc_do_statfs()
610 req->request = ceph_msg_new(CEPH_MSG_STATFS, sizeof(*h), GFP_NOFS, in ceph_monc_do_statfs()
612 if (!req->request) in ceph_monc_do_statfs()
614 req->reply = ceph_msg_new(CEPH_MSG_STATFS_REPLY, 1024, GFP_NOFS, in ceph_monc_do_statfs()
616 if (!req->reply) in ceph_monc_do_statfs()
620 h = req->request->front.iov_base; in ceph_monc_do_statfs()
626 err = do_generic_request(monc, req); in ceph_monc_do_statfs()
629 put_generic_request(req); in ceph_monc_do_statfs()
637 struct ceph_mon_generic_request *req; in handle_get_version_reply() local
651 req = __lookup_generic_req(monc, handle); in handle_get_version_reply()
652 if (req) { in handle_get_version_reply()
653 *(u64 *)req->buf = ceph_decode_64(&p); in handle_get_version_reply()
654 req->result = 0; in handle_get_version_reply()
655 get_generic_request(req); in handle_get_version_reply()
658 if (req) { in handle_get_version_reply()
659 complete_all(&req->completion); in handle_get_version_reply()
660 put_generic_request(req); in handle_get_version_reply()
677 struct ceph_mon_generic_request *req; in ceph_monc_do_get_version() local
682 req = kzalloc(sizeof(*req), GFP_NOFS); in ceph_monc_do_get_version()
683 if (!req) in ceph_monc_do_get_version()
686 kref_init(&req->kref); in ceph_monc_do_get_version()
687 req->buf = newest; in ceph_monc_do_get_version()
688 init_completion(&req->completion); in ceph_monc_do_get_version()
690 req->request = ceph_msg_new(CEPH_MSG_MON_GET_VERSION, in ceph_monc_do_get_version()
693 if (!req->request) { in ceph_monc_do_get_version()
698 req->reply = ceph_msg_new(CEPH_MSG_MON_GET_VERSION_REPLY, 1024, in ceph_monc_do_get_version()
700 if (!req->reply) { in ceph_monc_do_get_version()
705 p = req->request->front.iov_base; in ceph_monc_do_get_version()
706 end = p + req->request->front_alloc_len; in ceph_monc_do_get_version()
714 err = __do_generic_request(monc, tid, req); in ceph_monc_do_get_version()
718 put_generic_request(req); in ceph_monc_do_get_version()
728 struct ceph_mon_generic_request *req; in __resend_generic_request() local
732 req = rb_entry(p, struct ceph_mon_generic_request, node); in __resend_generic_request()
733 ceph_msg_revoke(req->request); in __resend_generic_request()
734 ceph_msg_revoke_incoming(req->reply); in __resend_generic_request()
735 ceph_con_send(&monc->con, ceph_msg_get(req->request)); in __resend_generic_request()