Commit 2a7c59e7 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Jens Axboe

remove sglist_len

Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 8889e3c1
...@@ -769,10 +769,8 @@ struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *cmd, gfp_t gfp_mask) ...@@ -769,10 +769,8 @@ struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *cmd, gfp_t gfp_mask)
/* /*
* first loop through, set initial index and return value * first loop through, set initial index and return value
*/ */
if (!ret) { if (!ret)
cmd->sglist_len = index;
ret = sgl; ret = sgl;
}
/* /*
* chain previous sglist, if any. we know the previous * chain previous sglist, if any. we know the previous
...@@ -825,8 +823,6 @@ void scsi_free_sgtable(struct scsi_cmnd *cmd) ...@@ -825,8 +823,6 @@ void scsi_free_sgtable(struct scsi_cmnd *cmd)
struct scatterlist *sgl = cmd->request_buffer; struct scatterlist *sgl = cmd->request_buffer;
struct scsi_host_sg_pool *sgp; struct scsi_host_sg_pool *sgp;
BUG_ON(cmd->sglist_len >= SG_MEMPOOL_NR);
/* /*
* if this is the biggest size sglist, check if we have * if this is the biggest size sglist, check if we have
* chained parts we need to free * chained parts we need to free
...@@ -861,9 +857,10 @@ void scsi_free_sgtable(struct scsi_cmnd *cmd) ...@@ -861,9 +857,10 @@ void scsi_free_sgtable(struct scsi_cmnd *cmd)
* Restore original, will be freed below * Restore original, will be freed below
*/ */
sgl = cmd->request_buffer; sgl = cmd->request_buffer;
} sgp = scsi_sg_pools + SG_MEMPOOL_NR - 1;
} else
sgp = scsi_sg_pools + scsi_sgtable_index(cmd->__use_sg);
sgp = scsi_sg_pools + cmd->sglist_len;
mempool_free(sgl, sgp->pool); mempool_free(sgl, sgp->pool);
} }
......
...@@ -69,7 +69,6 @@ struct scsi_cmnd { ...@@ -69,7 +69,6 @@ struct scsi_cmnd {
/* These elements define the operation we ultimately want to perform */ /* These elements define the operation we ultimately want to perform */
unsigned short use_sg; /* Number of pieces of scatter-gather */ unsigned short use_sg; /* Number of pieces of scatter-gather */
unsigned short sglist_len; /* size of malloc'd scatter-gather list */
unsigned short __use_sg; unsigned short __use_sg;
unsigned underflow; /* Return error if less than unsigned underflow; /* Return error if less than
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment