Remove iscsi_allocate_pdu_with_itt_flags_size()
We dont need this anymore.
This commit is contained in:
@@ -231,12 +231,6 @@ struct iscsi_pdu *iscsi_allocate_pdu_with_itt_flags(struct iscsi_context *iscsi,
|
|||||||
enum iscsi_opcode response_opcode,
|
enum iscsi_opcode response_opcode,
|
||||||
uint32_t itt,
|
uint32_t itt,
|
||||||
uint32_t flags);
|
uint32_t flags);
|
||||||
struct iscsi_pdu *iscsi_allocate_pdu_with_itt_flags_size(struct iscsi_context *iscsi,
|
|
||||||
enum iscsi_opcode opcode,
|
|
||||||
enum iscsi_opcode response_opcode,
|
|
||||||
uint32_t itt,
|
|
||||||
uint32_t flags,
|
|
||||||
size_t payload_size);
|
|
||||||
void iscsi_free_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu);
|
void iscsi_free_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu);
|
||||||
void iscsi_pdu_set_pduflags(struct iscsi_pdu *pdu, unsigned char flags);
|
void iscsi_pdu_set_pduflags(struct iscsi_pdu *pdu, unsigned char flags);
|
||||||
void iscsi_pdu_set_immediate(struct iscsi_pdu *pdu);
|
void iscsi_pdu_set_immediate(struct iscsi_pdu *pdu);
|
||||||
|
|||||||
@@ -706,10 +706,10 @@ iscsi_login_async(struct iscsi_context *iscsi, iscsi_command_cb cb,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdu = iscsi_allocate_pdu_with_itt_flags_size(iscsi,
|
pdu = iscsi_allocate_pdu_with_itt_flags(iscsi,
|
||||||
ISCSI_PDU_LOGIN_REQUEST,
|
ISCSI_PDU_LOGIN_REQUEST,
|
||||||
ISCSI_PDU_LOGIN_RESPONSE,
|
ISCSI_PDU_LOGIN_RESPONSE,
|
||||||
iscsi->itt, 0, 1024);
|
iscsi->itt, 0);
|
||||||
if (pdu == NULL) {
|
if (pdu == NULL) {
|
||||||
iscsi_set_error(iscsi, "Out-of-memory: Failed to allocate "
|
iscsi_set_error(iscsi, "Out-of-memory: Failed to allocate "
|
||||||
"login pdu.");
|
"login pdu.");
|
||||||
|
|||||||
16
lib/pdu.c
16
lib/pdu.c
@@ -31,8 +31,8 @@
|
|||||||
#include "slist.h"
|
#include "slist.h"
|
||||||
|
|
||||||
struct iscsi_pdu *
|
struct iscsi_pdu *
|
||||||
iscsi_allocate_pdu_with_itt_flags_size(struct iscsi_context *iscsi, enum iscsi_opcode opcode,
|
iscsi_allocate_pdu_with_itt_flags(struct iscsi_context *iscsi, enum iscsi_opcode opcode,
|
||||||
enum iscsi_opcode response_opcode, uint32_t itt, uint32_t flags, size_t payload_size)
|
enum iscsi_opcode response_opcode, uint32_t itt, uint32_t flags)
|
||||||
{
|
{
|
||||||
struct iscsi_pdu *pdu;
|
struct iscsi_pdu *pdu;
|
||||||
|
|
||||||
@@ -45,11 +45,6 @@ iscsi_allocate_pdu_with_itt_flags_size(struct iscsi_context *iscsi, enum iscsi_o
|
|||||||
pdu->outdata.size = ISCSI_HEADER_SIZE;
|
pdu->outdata.size = ISCSI_HEADER_SIZE;
|
||||||
pdu->outdata.alloc_size = 64;
|
pdu->outdata.alloc_size = 64;
|
||||||
|
|
||||||
/* payload_size is limited by negotiated max_recv_data_segment_length */
|
|
||||||
if (payload_size > iscsi->target_max_recv_data_segment_length)
|
|
||||||
payload_size = iscsi->target_max_recv_data_segment_length;
|
|
||||||
|
|
||||||
while (pdu->outdata.alloc_size < ISCSI_HEADER_SIZE+payload_size) pdu->outdata.alloc_size<<=1;
|
|
||||||
pdu->outdata.data = iscsi_malloc(iscsi, pdu->outdata.alloc_size);
|
pdu->outdata.data = iscsi_malloc(iscsi, pdu->outdata.alloc_size);
|
||||||
memset(pdu->outdata.data, 0, ISCSI_HEADER_SIZE);
|
memset(pdu->outdata.data, 0, ISCSI_HEADER_SIZE);
|
||||||
|
|
||||||
@@ -78,13 +73,6 @@ iscsi_allocate_pdu_with_itt_flags_size(struct iscsi_context *iscsi, enum iscsi_o
|
|||||||
return pdu;
|
return pdu;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct iscsi_pdu *
|
|
||||||
iscsi_allocate_pdu_with_itt_flags(struct iscsi_context *iscsi, enum iscsi_opcode opcode,
|
|
||||||
enum iscsi_opcode response_opcode, uint32_t itt, uint32_t flags)
|
|
||||||
{
|
|
||||||
return iscsi_allocate_pdu_with_itt_flags_size(iscsi, opcode, response_opcode, itt, flags, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct iscsi_pdu *
|
struct iscsi_pdu *
|
||||||
iscsi_allocate_pdu(struct iscsi_context *iscsi, enum iscsi_opcode opcode,
|
iscsi_allocate_pdu(struct iscsi_context *iscsi, enum iscsi_opcode opcode,
|
||||||
enum iscsi_opcode response_opcode)
|
enum iscsi_opcode response_opcode)
|
||||||
|
|||||||
Reference in New Issue
Block a user