Lines Matching refs:nents
555 static inline unsigned int scsi_sgtable_index(unsigned short nents) in scsi_sgtable_index() argument
559 BUG_ON(nents > SCSI_MAX_SG_SEGMENTS); in scsi_sgtable_index()
561 if (nents <= 8) in scsi_sgtable_index()
564 index = get_count_order(nents) - 3; in scsi_sgtable_index()
569 static void scsi_sg_free(struct scatterlist *sgl, unsigned int nents) in scsi_sg_free() argument
573 sgp = scsi_sg_pools + scsi_sgtable_index(nents); in scsi_sg_free()
577 static struct scatterlist *scsi_sg_alloc(unsigned int nents, gfp_t gfp_mask) in scsi_sg_alloc() argument
581 sgp = scsi_sg_pools + scsi_sgtable_index(nents); in scsi_sg_alloc()
592 static int scsi_alloc_sgtable(struct scsi_data_buffer *sdb, int nents, bool mq) in scsi_alloc_sgtable() argument
597 BUG_ON(!nents); in scsi_alloc_sgtable()
600 if (nents <= SCSI_MAX_SG_SEGMENTS) { in scsi_alloc_sgtable()
601 sdb->table.nents = sdb->table.orig_nents = nents; in scsi_alloc_sgtable()
602 sg_init_table(sdb->table.sgl, nents); in scsi_alloc_sgtable()
608 ret = __sg_alloc_table(&sdb->table, nents, SCSI_MAX_SG_SEGMENTS, in scsi_alloc_sgtable()
627 if (cmd->sdb.table.nents) in scsi_mq_free_sgtables()
670 if (cmd->sdb.table.nents) in scsi_release_buffers()
1099 BUG_ON(count > sdb->table.nents); in scsi_init_sgtable()
1100 sdb->table.nents = count; in scsi_init_sgtable()
1174 cmd->prot_sdb->table.nents = count; in scsi_init_io()