Lines Matching refs:req

418 	struct ceph_mon_generic_request *req;  in __lookup_generic_req()  local
422 req = rb_entry(n, struct ceph_mon_generic_request, node); in __lookup_generic_req()
423 if (tid < req->tid) in __lookup_generic_req()
425 else if (tid > req->tid) in __lookup_generic_req()
428 return req; in __lookup_generic_req()
438 struct ceph_mon_generic_request *req = NULL; in __insert_generic_request() local
442 req = rb_entry(parent, struct ceph_mon_generic_request, node); in __insert_generic_request()
443 if (new->tid < req->tid) in __insert_generic_request()
445 else if (new->tid > req->tid) in __insert_generic_request()
457 struct ceph_mon_generic_request *req = in release_generic_request() local
460 if (req->reply) in release_generic_request()
461 ceph_msg_put(req->reply); in release_generic_request()
462 if (req->request) in release_generic_request()
463 ceph_msg_put(req->request); in release_generic_request()
465 kfree(req); in release_generic_request()
468 static void put_generic_request(struct ceph_mon_generic_request *req) in put_generic_request() argument
470 kref_put(&req->kref, release_generic_request); in put_generic_request()
473 static void get_generic_request(struct ceph_mon_generic_request *req) in get_generic_request() argument
475 kref_get(&req->kref); in get_generic_request()
483 struct ceph_mon_generic_request *req; in get_generic_reply() local
488 req = __lookup_generic_req(monc, tid); in get_generic_reply()
489 if (!req) { in get_generic_reply()
494 dout("get_generic_reply %lld got %p\n", tid, req->reply); in get_generic_reply()
496 m = ceph_msg_get(req->reply); in get_generic_reply()
508 struct ceph_mon_generic_request *req) in __do_generic_request() argument
513 req->tid = tid != 0 ? tid : ++monc->last_tid; in __do_generic_request()
514 req->request->hdr.tid = cpu_to_le64(req->tid); in __do_generic_request()
515 __insert_generic_request(monc, req); in __do_generic_request()
517 ceph_con_send(&monc->con, ceph_msg_get(req->request)); in __do_generic_request()
520 err = wait_for_completion_interruptible(&req->completion); in __do_generic_request()
523 rb_erase(&req->node, &monc->generic_request_tree); in __do_generic_request()
527 err = req->result; in __do_generic_request()
532 struct ceph_mon_generic_request *req) in do_generic_request() argument
537 err = __do_generic_request(monc, 0, req); in do_generic_request()
549 struct ceph_mon_generic_request *req; in handle_statfs_reply() local
558 req = __lookup_generic_req(monc, tid); in handle_statfs_reply()
559 if (req) { in handle_statfs_reply()
560 *(struct ceph_statfs *)req->buf = reply->st; in handle_statfs_reply()
561 req->result = 0; in handle_statfs_reply()
562 get_generic_request(req); in handle_statfs_reply()
565 if (req) { in handle_statfs_reply()
566 complete_all(&req->completion); in handle_statfs_reply()
567 put_generic_request(req); in handle_statfs_reply()
581 struct ceph_mon_generic_request *req; in ceph_monc_do_statfs() local
585 req = kzalloc(sizeof(*req), GFP_NOFS); in ceph_monc_do_statfs()
586 if (!req) in ceph_monc_do_statfs()
589 kref_init(&req->kref); in ceph_monc_do_statfs()
590 req->buf = buf; in ceph_monc_do_statfs()
591 init_completion(&req->completion); in ceph_monc_do_statfs()
594 req->request = ceph_msg_new(CEPH_MSG_STATFS, sizeof(*h), GFP_NOFS, in ceph_monc_do_statfs()
596 if (!req->request) in ceph_monc_do_statfs()
598 req->reply = ceph_msg_new(CEPH_MSG_STATFS_REPLY, 1024, GFP_NOFS, in ceph_monc_do_statfs()
600 if (!req->reply) in ceph_monc_do_statfs()
604 h = req->request->front.iov_base; in ceph_monc_do_statfs()
610 err = do_generic_request(monc, req); in ceph_monc_do_statfs()
613 put_generic_request(req); in ceph_monc_do_statfs()
621 struct ceph_mon_generic_request *req; in handle_get_version_reply() local
635 req = __lookup_generic_req(monc, handle); in handle_get_version_reply()
636 if (req) { in handle_get_version_reply()
637 *(u64 *)req->buf = ceph_decode_64(&p); in handle_get_version_reply()
638 req->result = 0; in handle_get_version_reply()
639 get_generic_request(req); in handle_get_version_reply()
642 if (req) { in handle_get_version_reply()
643 complete_all(&req->completion); in handle_get_version_reply()
644 put_generic_request(req); in handle_get_version_reply()
661 struct ceph_mon_generic_request *req; in ceph_monc_do_get_version() local
666 req = kzalloc(sizeof(*req), GFP_NOFS); in ceph_monc_do_get_version()
667 if (!req) in ceph_monc_do_get_version()
670 kref_init(&req->kref); in ceph_monc_do_get_version()
671 req->buf = newest; in ceph_monc_do_get_version()
672 init_completion(&req->completion); in ceph_monc_do_get_version()
674 req->request = ceph_msg_new(CEPH_MSG_MON_GET_VERSION, in ceph_monc_do_get_version()
677 if (!req->request) { in ceph_monc_do_get_version()
682 req->reply = ceph_msg_new(CEPH_MSG_MON_GET_VERSION_REPLY, 1024, in ceph_monc_do_get_version()
684 if (!req->reply) { in ceph_monc_do_get_version()
689 p = req->request->front.iov_base; in ceph_monc_do_get_version()
690 end = p + req->request->front_alloc_len; in ceph_monc_do_get_version()
698 err = __do_generic_request(monc, tid, req); in ceph_monc_do_get_version()
702 put_generic_request(req); in ceph_monc_do_get_version()
712 struct ceph_mon_generic_request *req; in __resend_generic_request() local
716 req = rb_entry(p, struct ceph_mon_generic_request, node); in __resend_generic_request()
717 ceph_msg_revoke(req->request); in __resend_generic_request()
718 ceph_msg_revoke_incoming(req->reply); in __resend_generic_request()
719 ceph_con_send(&monc->con, ceph_msg_get(req->request)); in __resend_generic_request()