diff options
author | Olaf Kirch <olaf.kirch@oracle.com> | 2007-12-13 13:43:25 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-11 19:28:27 -0500 |
commit | 6320377fd94316e58f75d0be6f6e7a644950a4ee (patch) | |
tree | 7c7b47e6bafae9f25cfd9e1416494b6406c2d0b9 /drivers/scsi/iscsi_tcp.h | |
parent | 38ad03de3fd350e683213ddf898a7049534628a8 (diff) |
[SCSI] libiscsi, iscsi_tcp: iscsi pool cleanup
iscsi_pool_init simplified
iscsi_pool_init currently has a lot of duplicate kfree() calls it does
when some allocation fails. This patch simplifies the code a little by
using iscsi_pool_free to tear down the pool in case of an error.
iscsi_pool_init also returns a copy of the item array to the caller.
Not all callers use this array, so we make it optional.
Instead of allocating a second array and return that, allocate just one
array, of twice the size.
Update users of iscsi_pool_{init,free}
This patch drops the (now useless) second argument to
iscsi_pool_free, and updates all callers.
It also removes the ctask->r2ts array, which was never
used anyway. Since the items argument to iscsi_pool_init
is now optional, we can pass NULL instead.
Signed-off-by: Olaf Kirch <olaf.kirch@oracle.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/iscsi_tcp.h')
-rw-r--r-- | drivers/scsi/iscsi_tcp.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/scsi/iscsi_tcp.h b/drivers/scsi/iscsi_tcp.h index eb3784f949fd..d49d87611e82 100644 --- a/drivers/scsi/iscsi_tcp.h +++ b/drivers/scsi/iscsi_tcp.h | |||
@@ -175,9 +175,8 @@ struct iscsi_tcp_cmd_task { | |||
175 | uint32_t exp_datasn; /* expected target's R2TSN/DataSN */ | 175 | uint32_t exp_datasn; /* expected target's R2TSN/DataSN */ |
176 | int data_offset; | 176 | int data_offset; |
177 | struct iscsi_r2t_info *r2t; /* in progress R2T */ | 177 | struct iscsi_r2t_info *r2t; /* in progress R2T */ |
178 | struct iscsi_queue r2tpool; | 178 | struct iscsi_pool r2tpool; |
179 | struct kfifo *r2tqueue; | 179 | struct kfifo *r2tqueue; |
180 | struct iscsi_r2t_info **r2ts; | ||
181 | int digest_count; | 180 | int digest_count; |
182 | uint32_t immdigest; /* for imm data */ | 181 | uint32_t immdigest; /* for imm data */ |
183 | struct iscsi_buf immbuf; /* for imm data digest */ | 182 | struct iscsi_buf immbuf; /* for imm data digest */ |