Lines Matching refs:nents
554 static inline unsigned int scsi_sgtable_index(unsigned short nents) in scsi_sgtable_index() argument
558 BUG_ON(nents > SCSI_MAX_SG_SEGMENTS); in scsi_sgtable_index()
560 if (nents <= 8) in scsi_sgtable_index()
563 index = get_count_order(nents) - 3; in scsi_sgtable_index()
568 static void scsi_sg_free(struct scatterlist *sgl, unsigned int nents) in scsi_sg_free() argument
572 sgp = scsi_sg_pools + scsi_sgtable_index(nents); in scsi_sg_free()
576 static struct scatterlist *scsi_sg_alloc(unsigned int nents, gfp_t gfp_mask) in scsi_sg_alloc() argument
580 sgp = scsi_sg_pools + scsi_sgtable_index(nents); in scsi_sg_alloc()
591 static int scsi_alloc_sgtable(struct scsi_data_buffer *sdb, int nents, bool mq) in scsi_alloc_sgtable() argument
596 BUG_ON(!nents); in scsi_alloc_sgtable()
599 if (nents <= SCSI_MAX_SG_SEGMENTS) { in scsi_alloc_sgtable()
600 sdb->table.nents = sdb->table.orig_nents = nents; in scsi_alloc_sgtable()
601 sg_init_table(sdb->table.sgl, nents); in scsi_alloc_sgtable()
607 ret = __sg_alloc_table(&sdb->table, nents, SCSI_MAX_SG_SEGMENTS, in scsi_alloc_sgtable()
626 if (cmd->sdb.table.nents) in scsi_mq_free_sgtables()
669 if (cmd->sdb.table.nents) in scsi_release_buffers()
1098 BUG_ON(count > sdb->table.nents); in scsi_init_sgtable()
1099 sdb->table.nents = count; in scsi_init_sgtable()
1173 cmd->prot_sdb->table.nents = count; in scsi_init_io()