Lines Matching refs:sdb
639 static int scsi_alloc_sgtable(struct scsi_data_buffer *sdb, int nents, in scsi_alloc_sgtable() argument
646 ret = __sg_alloc_table(&sdb->table, nents, SCSI_MAX_SG_SEGMENTS, in scsi_alloc_sgtable()
649 __sg_free_table(&sdb->table, SCSI_MAX_SG_SEGMENTS, in scsi_alloc_sgtable()
655 static void scsi_free_sgtable(struct scsi_data_buffer *sdb) in scsi_free_sgtable() argument
657 __sg_free_table(&sdb->table, SCSI_MAX_SG_SEGMENTS, scsi_sg_free); in scsi_free_sgtable()
663 if (cmd->sdb.table.nents) in __scsi_release_buffers()
664 scsi_free_sgtable(&cmd->sdb); in __scsi_release_buffers()
666 memset(&cmd->sdb, 0, sizeof(cmd->sdb)); in __scsi_release_buffers()
1012 static int scsi_init_sgtable(struct request *req, struct scsi_data_buffer *sdb, in scsi_init_sgtable() argument
1020 if (unlikely(scsi_alloc_sgtable(sdb, req->nr_phys_segments, in scsi_init_sgtable()
1031 count = blk_rq_map_sg(req->q, req, sdb->table.sgl); in scsi_init_sgtable()
1032 BUG_ON(count > sdb->table.nents); in scsi_init_sgtable()
1033 sdb->table.nents = count; in scsi_init_sgtable()
1034 sdb->length = blk_rq_bytes(req); in scsi_init_sgtable()
1053 int error = scsi_init_sgtable(rq, &cmd->sdb, gfp_mask); in scsi_init_io()
1155 memset(&cmd->sdb, 0, sizeof(cmd->sdb)); in scsi_setup_blk_pc_cmnd()