From 344b21d37d1eae3b64238d8b96a9c72eeda9e91d Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Mon, 16 Jun 2014 16:23:28 +0200 Subject: [PATCH] logout: allow additional PDU flags to be passed internally Signed-off-by: Peter Lieven --- include/iscsi-private.h | 4 ++++ lib/login.c | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/iscsi-private.h b/include/iscsi-private.h index b433fdf..d03a4ba 100644 --- a/include/iscsi-private.h +++ b/include/iscsi-private.h @@ -350,6 +350,10 @@ iscsi_itt_post_increment(struct iscsi_context *iscsi); void iscsi_timeout_scan(struct iscsi_context *iscsi); +int +iscsi_logout_async_internal(struct iscsi_context *iscsi, iscsi_command_cb cb, + void *private_data, uint32_t flags); + #ifdef __cplusplus } #endif diff --git a/lib/login.c b/lib/login.c index 492df3b..493b2bc 100644 --- a/lib/login.c +++ b/lib/login.c @@ -1117,10 +1117,9 @@ iscsi_process_login_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu, return 0; } - int -iscsi_logout_async(struct iscsi_context *iscsi, iscsi_command_cb cb, - void *private_data) +iscsi_logout_async_internal(struct iscsi_context *iscsi, iscsi_command_cb cb, + void *private_data, uint32_t flags) { struct iscsi_pdu *pdu; @@ -1154,7 +1153,7 @@ iscsi_logout_async(struct iscsi_context *iscsi, iscsi_command_cb cb, pdu->callback = cb; pdu->private_data = private_data; - pdu->flags |= ISCSI_PDU_CORK_WHEN_SENT; + pdu->flags |= ISCSI_PDU_CORK_WHEN_SENT | flags; if (iscsi_queue_pdu(iscsi, pdu) != 0) { iscsi_set_error(iscsi, "Out-of-memory: failed to queue iscsi " @@ -1166,6 +1165,13 @@ iscsi_logout_async(struct iscsi_context *iscsi, iscsi_command_cb cb, return 0; } +int +iscsi_logout_async(struct iscsi_context *iscsi, iscsi_command_cb cb, + void *private_data) +{ + return iscsi_logout_async_internal(iscsi, cb, private_data, 0); +} + int iscsi_process_logout_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu, struct iscsi_in_pdu *in)