Make scsi_allocated_memory private to scsi-lowlevel and remove the ptr pointer
Change the list-head structure for in-task scsi memory allocations to be private to scsi-lowlevel since is is never accessed from anyehwere else and it is private to this function. Remove the pointer to the user data in the list head and replace it with a zero length buffer at the end of the header. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
@@ -299,11 +299,6 @@ struct scsi_data {
|
||||
unsigned char *data;
|
||||
};
|
||||
|
||||
struct scsi_allocated_memory {
|
||||
struct scsi_allocated_memory *next;
|
||||
void *ptr;
|
||||
};
|
||||
|
||||
enum scsi_residual {
|
||||
SCSI_RESIDUAL_NO_RESIDUAL = 0,
|
||||
SCSI_RESIDUAL_UNDERFLOW,
|
||||
|
||||
@@ -39,6 +39,10 @@
|
||||
#include "scsi-lowlevel.h"
|
||||
#include "iscsi-private.h"
|
||||
|
||||
struct scsi_allocated_memory {
|
||||
struct scsi_allocated_memory *next;
|
||||
char buf[0];
|
||||
};
|
||||
|
||||
void
|
||||
scsi_free_scsi_task(struct scsi_task *task)
|
||||
@@ -64,9 +68,8 @@ scsi_malloc(struct scsi_task *task, size_t size)
|
||||
return NULL;
|
||||
}
|
||||
memset(mem, 0, sizeof(struct scsi_allocated_memory) + size);
|
||||
mem->ptr = (void *) ((uintptr_t)mem + sizeof(struct scsi_allocated_memory));
|
||||
SLIST_ADD(&task->mem, mem);
|
||||
return mem->ptr;
|
||||
return &mem->buf[0];
|
||||
}
|
||||
|
||||
struct value_string {
|
||||
|
||||
Reference in New Issue
Block a user