projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sg: incorporate sg_build_direct into sg_start_req
[cascardo/linux.git]
/
drivers
/
scsi
/
libsrp.c
diff --git
a/drivers/scsi/libsrp.c
b/drivers/scsi/libsrp.c
index
2ad0a27
..
15e2d13
100644
(file)
--- a/
drivers/scsi/libsrp.c
+++ b/
drivers/scsi/libsrp.c
@@
-39,7
+39,7
@@
enum srp_task_attributes {
/* tmp - will replace with SCSI logging stuff */
#define eprintk(fmt, args...) \
do { \
/* tmp - will replace with SCSI logging stuff */
#define eprintk(fmt, args...) \
do { \
- printk("%s(%d) " fmt, __
FUNCTION__, __LINE__, ##args);
\
+ printk("%s(%d) " fmt, __
func__, __LINE__, ##args);
\
} while (0)
/* #define dprintk eprintk */
#define dprintk(fmt, args...)
} while (0)
/* #define dprintk eprintk */
#define dprintk(fmt, args...)
@@
-192,18
+192,18
@@
static int srp_direct_data(struct scsi_cmnd *sc, struct srp_direct_buf *md,
if (dma_map) {
iue = (struct iu_entry *) sc->SCp.ptr;
if (dma_map) {
iue = (struct iu_entry *) sc->SCp.ptr;
- sg = sc
->request_buffer
;
+ sg = sc
si_sglist(sc)
;
- dprintk("%p %u %u %d\n", iue, sc
->request_bufflen
,
- md->len, sc
->use_sg
);
+ dprintk("%p %u %u %d\n", iue, sc
si_bufflen(sc)
,
+ md->len, sc
si_sg_count(sc)
);
- nsg = dma_map_sg(iue->target->dev, sg, sc
->use_sg
,
+ nsg = dma_map_sg(iue->target->dev, sg, sc
si_sg_count(sc)
,
DMA_BIDIRECTIONAL);
if (!nsg) {
DMA_BIDIRECTIONAL);
if (!nsg) {
- printk("fail to map %p %d\n", iue, sc
->use_sg
);
+ printk("fail to map %p %d\n", iue, sc
si_sg_count(sc)
);
return 0;
}
return 0;
}
- len = min(sc
->request_bufflen
, md->len);
+ len = min(sc
si_bufflen(sc)
, md->len);
} else
len = md->len;
} else
len = md->len;
@@
-229,10
+229,10
@@
static int srp_indirect_data(struct scsi_cmnd *sc, struct srp_cmd *cmd,
if (dma_map || ext_desc) {
iue = (struct iu_entry *) sc->SCp.ptr;
if (dma_map || ext_desc) {
iue = (struct iu_entry *) sc->SCp.ptr;
- sg = sc
->request_buffer
;
+ sg = sc
si_sglist(sc)
;
dprintk("%p %u %u %d %d\n",
dprintk("%p %u %u %d %d\n",
- iue, sc
->request_bufflen
, id->len,
+ iue, sc
si_bufflen(sc)
, id->len,
cmd->data_in_desc_cnt, cmd->data_out_desc_cnt);
}
cmd->data_in_desc_cnt, cmd->data_out_desc_cnt);
}
@@
-268,13
+268,14
@@
static int srp_indirect_data(struct scsi_cmnd *sc, struct srp_cmd *cmd,
rdma:
if (dma_map) {
rdma:
if (dma_map) {
- nsg = dma_map_sg(iue->target->dev, sg, sc->use_sg, DMA_BIDIRECTIONAL);
+ nsg = dma_map_sg(iue->target->dev, sg, scsi_sg_count(sc),
+ DMA_BIDIRECTIONAL);
if (!nsg) {
if (!nsg) {
- eprintk("fail to map %p %d\n", iue, sc
->use_sg
);
+ eprintk("fail to map %p %d\n", iue, sc
si_sg_count(sc)
);
err = -EIO;
goto free_mem;
}
err = -EIO;
goto free_mem;
}
- len = min(sc
->request_bufflen
, id->len);
+ len = min(sc
si_bufflen(sc)
, id->len);
} else
len = id->len;
} else
len = id->len;
@@
-425,8
+426,8
@@
int srp_cmd_queue(struct Scsi_Host *shost, struct srp_cmd *cmd, void *info,
sc->SCp.ptr = info;
memcpy(sc->cmnd, cmd->cdb, MAX_COMMAND_SIZE);
sc->SCp.ptr = info;
memcpy(sc->cmnd, cmd->cdb, MAX_COMMAND_SIZE);
- sc->
request_bufflen
= len;
- sc->
request_buffer
= (void *) (unsigned long) addr;
+ sc->
sdb.length
= len;
+ sc->
sdb.table.sgl
= (void *) (unsigned long) addr;
sc->tag = tag;
err = scsi_tgt_queue_command(sc, itn_id, (struct scsi_lun *)&cmd->lun,
cmd->tag);
sc->tag = tag;
err = scsi_tgt_queue_command(sc, itn_id, (struct scsi_lun *)&cmd->lun,
cmd->tag);