Lines Matching defs:con

71 	struct hmdfs_peer *con;
75 con = msg_wq->head.peer;
76 idr_remove(&con->msg_idr, msg_wq->head.msg_id);
77 spin_unlock(&con->idr_lock);
85 // Always remember to find before put, and make sure con is avilable
99 static int msg_init(struct hmdfs_peer *con, struct sendmsg_wait_queue *msg_wq,
105 ret = hmdfs_alloc_msg_idr(con, MSG_IDR_MESSAGE_SYNC, msg_wq, operations);
116 static inline void statistic_con_sb_dirty(struct hmdfs_peer *con,
120 atomic64_inc(&con->sb_dirty_count);
205 int hmdfs_sendmessage_response(struct hmdfs_peer *con,
229 ret = hmdfs_sendmessage(con, &msg);
370 static int hmdfs_record_async_readdir(struct hmdfs_peer *con,
373 struct hmdfs_sb_info *sbi = con->sbi;
387 static void hmdfs_untrack_async_readdir(struct hmdfs_peer *con,
390 struct hmdfs_sb_info *sbi = con->sbi;
397 int hmdfs_sendmessage_request(struct hmdfs_peer *con,
406 get_cmd_timeout(con->sbi, sm->operations.command);
410 if (!hmdfs_is_node_online(con)) {
442 ret = msg_init(con, msg_wq, sm->operations);
459 ret = hmdfs_sendmessage(con, &msg);
462 con->device_id, head->msg_id);
469 hmdfs_dec_msg_idr_process(con);
473 ret = hmdfs_record_async_readdir(con, msg_wq);
485 hmdfs_untrack_async_readdir(con, msg_wq);
489 con->device_id, head->msg_id,
494 hmdfs_client_resp_statis(con->sbi, sm->operations.command,
507 hmdfs_dec_msg_idr_process(con);
518 static int hmdfs_send_slice(struct hmdfs_peer *con, struct hmdfs_head_cmd *cmd,
545 ret = hmdfs_sendmessage(con, &msg);
550 int hmdfs_readfile_response(struct hmdfs_peer *con, struct hmdfs_head_cmd *head,
562 return hmdfs_sendmessage_response(con, head, 0, NULL, 0);
584 ret = hmdfs_send_slice(con, head, &sdesc, slice_buf);
597 hmdfs_sendmessage_response(con, head, 0, NULL, ret);
631 int hmdfs_sendpage_request(struct hmdfs_peer *con,
644 timeout = get_cmd_timeout(con->sbi, sm->operations.command);
652 if (!hmdfs_is_node_online(con)) {
679 ret = hmdfs_alloc_msg_idr(con, MSG_IDR_PAGE, async_work, sm->operations);
688 ret = queue_delayed_work(con->async_wq, &async_work->d_work,
694 ret = hmdfs_sendmessage(con, &msg);
697 con->device_id, head.msg_id);
701 hmdfs_dec_msg_idr_process(con);
708 hmdfs_dec_msg_idr_process(con);
714 hmdfs_dec_msg_idr_process(con);
723 static void hmdfs_request_handle_sync(struct hmdfs_peer *con,
735 s_recv_callbacks[head->operations.command](con, head, buf);
736 hmdfs_statistic(con->sbi, head->operations.command, jiffies - start);
743 static void hmdfs_msg_handle_sync(struct hmdfs_peer *con,
746 const struct cred *old_cred = hmdfs_override_creds(con->sbi->cred);
756 hmdfs_request_handle_sync(con, head, buf);
774 static int hmdfs_msg_handle_async(struct hmdfs_peer *con,
796 desp->peer = con;
801 peer_get(con);
812 static int hmdfs_request_recv(struct hmdfs_peer *con,
845 ret = hmdfs_msg_handle_async(con, head, buf, con->req_handle_wq,
850 hmdfs_msg_handle_sync(con, head, buf);
963 int hmdfs_response_handle_sync(struct hmdfs_peer *con,
973 msg_head = hmdfs_find_msg_head(con, msg_id, head->operations);
984 hmdfs_client_resp_statis(con->sbi, cmd,
1001 queue_delayed_work(con->async_wq, &mp->d_work, 0);
1002 hmdfs_client_resp_statis(con->sbi, cmd,
1018 hmdfs_client_resp_statis(con->sbi, cmd, HMDFS_RESP_DELAY, 0, 0);
1023 static int hmdfs_response_recv(struct hmdfs_peer *con,
1054 ret = hmdfs_response_handle_sync(con, head, buf);
1058 ret = hmdfs_msg_handle_async(con, head, buf, con->async_wq,
1070 void hmdfs_recv_mesg_callback(struct hmdfs_peer *con, void *head,
1077 if (hmdfs_message_verify(con, hmdfs_head, buf) < 0) {
1084 if (hmdfs_request_recv(con, hmdfs_head, buf) < 0)
1089 if (hmdfs_response_recv(con, hmdfs_head, buf) < 0)