Skip to content

Commit

Permalink
remove sglist_len
Browse files Browse the repository at this point in the history
Signed-off-by: FUJITA Tomonori <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
fujita authored and Jens Axboe committed Oct 16, 2007
1 parent 8889e3c commit 2a7c59e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
11 changes: 4 additions & 7 deletions drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
if (!ret) {
cmd->sglist_len = index;
if (!ret)
ret = sgl;
}

/*
* chain previous sglist, if any. we know the previous
Expand Down Expand Up @@ -825,8 +823,6 @@ void scsi_free_sgtable(struct scsi_cmnd *cmd)
struct scatterlist *sgl = cmd->request_buffer;
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
* chained parts we need to free
Expand Down Expand Up @@ -861,9 +857,10 @@ void scsi_free_sgtable(struct scsi_cmnd *cmd)
* Restore original, will be freed below
*/
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);
}

Expand Down
1 change: 0 additions & 1 deletion include/scsi/scsi_cmnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ struct scsi_cmnd {

/* These elements define the operation we ultimately want to perform */
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 underflow; /* Return error if less than
Expand Down

0 comments on commit 2a7c59e

Please sign in to comment.