Commit 394f7d3d authored by Zhang Jingwang's avatar Zhang Jingwang Committed by Dries Kimpe
Browse files

Revert "change zoidfs c client to use BMI_testcontext instead of BMI_test"

Using BMI_testcontext will break multi-threaded applications.

This reverts commit 055c6757.
parent 86837340
......@@ -44,7 +44,8 @@ int bmi_comm_send(BMI_addr_t peer_addr, const void *buffer, bmi_size_t buflen,
return bmi2zfs(ret);
} else if (ret == 0) {
do {
ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL,
MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
......@@ -93,7 +94,7 @@ int bmi_comm_isend_wait(bmi_op_id_t op_id, bmi_size_t buflen, bmi_context_id con
bmi_error_code_t error_code;
do {
ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0)
......@@ -129,7 +130,8 @@ int bmi_comm_recv(BMI_addr_t peer_addr, void *buffer, bmi_size_t buflen,
return bmi2zfs(ret);
} else if (ret == 0) {
do {
ret = BMI_testcontext(1, &op_id, &outcount, &error_code, actual_size, NULL, MAX_IDLE_TIME, context);
ret = BMI_test(op_id, &outcount, &error_code, actual_size, NULL,
MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
......@@ -153,7 +155,7 @@ int bmi_comm_irecv_wait(bmi_op_id_t op_id, bmi_size_t * actual_size, bmi_context
bmi_error_code_t error_code;
do {
ret = BMI_testcontext(1, &op_id, &outcount, &error_code, actual_size, NULL, MAX_IDLE_TIME, context);
ret = BMI_test(op_id, &outcount, &error_code, actual_size, NULL, MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0)
......@@ -202,7 +204,8 @@ int bmi_comm_sendu(BMI_addr_t peer_addr, const void *buffer, bmi_size_t buflen,
return bmi2zfs(ret);
} else if (ret == 0) {
do {
ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL,
MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
......@@ -246,7 +249,8 @@ int bmi_comm_isendu_wait(bmi_size_t buflen, bmi_context_id context, bmi_op_id_t
bmi_error_code_t error_code;
do {
ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL,
MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
......@@ -324,7 +328,8 @@ int bmi_comm_send_list(BMI_addr_t peer_addr, size_t list_count,
return bmi2zfs(ret);
} else if (ret == 0) {
do {
ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL,
MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
......@@ -370,7 +375,8 @@ int bmi_comm_isend_list_wait(bmi_op_id_t op_id, bmi_context_id context, bmi_size
do
{
ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL,
MAX_IDLE_TIME, context);
}while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
......@@ -409,7 +415,8 @@ int bmi_comm_recv_list(BMI_addr_t peer_addr, size_t list_count,
return bmi2zfs(ret);
} else if (ret == 0) {
do {
ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL,
MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
......@@ -450,7 +457,8 @@ int bmi_comm_irecv_list_wait(bmi_op_id_t op_id, bmi_context_id context, bmi_size
do
{
ret = BMI_testcontext(1, &op_id, &outcount, &error_code, actual_size, NULL, MAX_IDLE_TIME, context);
ret = BMI_test(op_id, &outcount, &error_code, actual_size, NULL,
MAX_IDLE_TIME, context);
}while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment