PDU further optimize iscsi_add_data()

This patch further improves add data and esepcially preassigns
the right amount of memory where the amount is preknown
This commit is contained in:
Peter Lieven
2012-11-05 15:13:50 +01:00
parent b5183d5e30
commit 65cd38e8ff
5 changed files with 51 additions and 14 deletions

View File

@@ -735,10 +735,10 @@ iscsi_login_async(struct iscsi_context *iscsi, iscsi_command_cb cb,
return -1;
}
pdu = iscsi_allocate_pdu_with_itt_flags(iscsi,
pdu = iscsi_allocate_pdu_with_itt_flags_size(iscsi,
ISCSI_PDU_LOGIN_REQUEST,
ISCSI_PDU_LOGIN_RESPONSE,
iscsi->itt, 0);
iscsi->itt, 0, 1024);
if (pdu == NULL) {
iscsi_set_error(iscsi, "Out-of-memory: Failed to allocate "
"login pdu.");