aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_cmnd.h
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-11-15 03:13:11 -0500
committerJens Axboe <jens.axboe@oracle.com>2008-01-28 04:05:27 -0500
commit5ed7959ede0936c55e50421a53f153b17080e876 (patch)
tree52fae9cd4959b7855e37c5dc4d0ce7eb22656cdb /include/scsi/scsi_cmnd.h
parent0db9299f48ebd4a860d6ad4e1d36ac50671d48e7 (diff)
SG: Convert SCSI to use scatterlist helpers for sg chaining
Also change scsi_alloc_sgtable() to just return 0/failure, since it maps to the command passed in. ->request_buffer is now no longer needed, once drivers are adapted to use scsi_sglist() it can be killed. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/scsi/scsi_cmnd.h')
-rw-r--r--include/scsi/scsi_cmnd.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index abd7479ff452..a457fca66f61 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -8,7 +8,6 @@
8#include <linux/scatterlist.h> 8#include <linux/scatterlist.h>
9 9
10struct request; 10struct request;
11struct scatterlist;
12struct Scsi_Host; 11struct Scsi_Host;
13struct scsi_device; 12struct scsi_device;
14 13
@@ -68,8 +67,8 @@ struct scsi_cmnd {
68 void *request_buffer; /* Actual requested buffer */ 67 void *request_buffer; /* Actual requested buffer */
69 68
70 /* These elements define the operation we ultimately want to perform */ 69 /* These elements define the operation we ultimately want to perform */
70 struct sg_table sg_table;
71 unsigned short use_sg; /* Number of pieces of scatter-gather */ 71 unsigned short use_sg; /* Number of pieces of scatter-gather */
72 unsigned short __use_sg;
73 72
74 unsigned underflow; /* Return error if less than 73 unsigned underflow; /* Return error if less than
75 this amount is transferred */ 74 this amount is transferred */
@@ -128,14 +127,14 @@ extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count,
128 size_t *offset, size_t *len); 127 size_t *offset, size_t *len);
129extern void scsi_kunmap_atomic_sg(void *virt); 128extern void scsi_kunmap_atomic_sg(void *virt);
130 129
131extern struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *, gfp_t); 130extern int scsi_alloc_sgtable(struct scsi_cmnd *, gfp_t);
132extern void scsi_free_sgtable(struct scsi_cmnd *); 131extern void scsi_free_sgtable(struct scsi_cmnd *);
133 132
134extern int scsi_dma_map(struct scsi_cmnd *cmd); 133extern int scsi_dma_map(struct scsi_cmnd *cmd);
135extern void scsi_dma_unmap(struct scsi_cmnd *cmd); 134extern void scsi_dma_unmap(struct scsi_cmnd *cmd);
136 135
137#define scsi_sg_count(cmd) ((cmd)->use_sg) 136#define scsi_sg_count(cmd) ((cmd)->use_sg)
138#define scsi_sglist(cmd) ((struct scatterlist *)(cmd)->request_buffer) 137#define scsi_sglist(cmd) ((cmd)->sg_table.sgl)
139#define scsi_bufflen(cmd) ((cmd)->request_bufflen) 138#define scsi_bufflen(cmd) ((cmd)->request_bufflen)
140 139
141static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid) 140static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid)