Lines Matching refs:nb_sectors

883     uint64_t nb_sectors;  in media_is_dvd()  local
890 blk_get_geometry(s->qdev.conf.blk, &nb_sectors); in media_is_dvd()
891 return nb_sectors > CD_MAX_SECTORS; in media_is_dvd()
896 uint64_t nb_sectors; in media_is_cd() local
903 blk_get_geometry(s->qdev.conf.blk, &nb_sectors); in media_is_cd()
904 return nb_sectors <= CD_MAX_SECTORS; in media_is_cd()
982 uint64_t nb_sectors; in scsi_read_dvd_structure() local
986 blk_get_geometry(s->qdev.conf.blk, &nb_sectors); in scsi_read_dvd_structure()
993 stl_be_p(&outbuf[12], (nb_sectors >> 2) - 1); /* end sector */ in scsi_read_dvd_structure()
994 stl_be_p(&outbuf[16], (nb_sectors >> 2) - 1); /* l0 end sector */ in scsi_read_dvd_structure()
1349 uint64_t nb_sectors; in scsi_disk_emulate_mode_sense() local
1405 blk_get_geometry(s->qdev.conf.blk, &nb_sectors); in scsi_disk_emulate_mode_sense()
1406 if (!dbd && nb_sectors) { in scsi_disk_emulate_mode_sense()
1412 nb_sectors /= (s->qdev.blocksize / BDRV_SECTOR_SIZE); in scsi_disk_emulate_mode_sense()
1413 if (nb_sectors > 0xffffff) { in scsi_disk_emulate_mode_sense()
1414 nb_sectors = 0; in scsi_disk_emulate_mode_sense()
1417 p[1] = (nb_sectors >> 16) & 0xff; in scsi_disk_emulate_mode_sense()
1418 p[2] = (nb_sectors >> 8) & 0xff; in scsi_disk_emulate_mode_sense()
1419 p[3] = nb_sectors & 0xff; in scsi_disk_emulate_mode_sense()
1463 uint64_t nb_sectors; in scsi_disk_emulate_read_toc() local
1468 blk_get_geometry(s->qdev.conf.blk, &nb_sectors); in scsi_disk_emulate_read_toc()
1470 nb_sectors /= s->qdev.blocksize / BDRV_SECTOR_SIZE; in scsi_disk_emulate_read_toc()
1473 toclen = cdrom_read_toc(nb_sectors, outbuf, msf, start_track); in scsi_disk_emulate_read_toc()
1484 toclen = cdrom_read_toc_raw(nb_sectors, outbuf, msf, start_track); in scsi_disk_emulate_read_toc()
1739 uint64_t sector_num, uint32_t nb_sectors) in check_lba_range() argument
1750 return (sector_num <= sector_num + nb_sectors && in check_lba_range()
1751 sector_num + nb_sectors <= s->qdev.max_lba + 1); in check_lba_range()
1771 uint32_t nb_sectors = ldl_be_p(&data->inbuf[8]) & 0xffffffffULL; in scsi_unmap_complete_noio() local
1773 r->sector_count = nb_sectors * (s->qdev.blocksize / BDRV_SECTOR_SIZE); in scsi_unmap_complete_noio()
1775 if (!check_lba_range(s, sector_num, nb_sectors)) { in scsi_unmap_complete_noio()
1874 int nb_sectors; member
1894 data->nb_sectors -= data->iov.iov_len / BDRV_SECTOR_SIZE; in scsi_write_same_complete()
1896 data->iov.iov_len = MIN(data->nb_sectors * BDRV_SECTOR_SIZE, in scsi_write_same_complete()
1923 uint32_t nb_sectors = scsi_data_cdb_xfer(r->req.cmd.buf); in scsi_disk_emulate_write_same() local
1929 if (nb_sectors == 0 || (req->cmd.buf[1] & 0x16)) { in scsi_disk_emulate_write_same()
1938 if (!check_lba_range(s, r->req.cmd.lba, nb_sectors)) { in scsi_disk_emulate_write_same()
1949 nb_sectors * s->qdev.blocksize, in scsi_disk_emulate_write_same()
1953 nb_sectors * s->qdev.blocksize, in scsi_disk_emulate_write_same()
1961 data->nb_sectors = nb_sectors * (s->qdev.blocksize / BDRV_SECTOR_SIZE); in scsi_disk_emulate_write_same()
1962 data->iov.iov_len = MIN(data->nb_sectors * BDRV_SECTOR_SIZE, in scsi_disk_emulate_write_same()
2031 uint64_t nb_sectors; in scsi_disk_emulate_command() local
2133 blk_get_geometry(s->qdev.conf.blk, &nb_sectors); in scsi_disk_emulate_command()
2134 if (!nb_sectors) { in scsi_disk_emulate_command()
2141 nb_sectors /= s->qdev.blocksize / BDRV_SECTOR_SIZE; in scsi_disk_emulate_command()
2143 nb_sectors--; in scsi_disk_emulate_command()
2145 s->qdev.max_lba = nb_sectors; in scsi_disk_emulate_command()
2147 if (nb_sectors > UINT32_MAX) { in scsi_disk_emulate_command()
2148 nb_sectors = UINT32_MAX; in scsi_disk_emulate_command()
2150 outbuf[0] = (nb_sectors >> 24) & 0xff; in scsi_disk_emulate_command()
2151 outbuf[1] = (nb_sectors >> 16) & 0xff; in scsi_disk_emulate_command()
2152 outbuf[2] = (nb_sectors >> 8) & 0xff; in scsi_disk_emulate_command()
2153 outbuf[3] = nb_sectors & 0xff; in scsi_disk_emulate_command()
2202 blk_get_geometry(s->qdev.conf.blk, &nb_sectors); in scsi_disk_emulate_command()
2203 if (!nb_sectors) { in scsi_disk_emulate_command()
2210 nb_sectors /= s->qdev.blocksize / BDRV_SECTOR_SIZE; in scsi_disk_emulate_command()
2212 nb_sectors--; in scsi_disk_emulate_command()
2214 s->qdev.max_lba = nb_sectors; in scsi_disk_emulate_command()
2215 outbuf[0] = (nb_sectors >> 56) & 0xff; in scsi_disk_emulate_command()
2216 outbuf[1] = (nb_sectors >> 48) & 0xff; in scsi_disk_emulate_command()
2217 outbuf[2] = (nb_sectors >> 40) & 0xff; in scsi_disk_emulate_command()
2218 outbuf[3] = (nb_sectors >> 32) & 0xff; in scsi_disk_emulate_command()
2219 outbuf[4] = (nb_sectors >> 24) & 0xff; in scsi_disk_emulate_command()
2220 outbuf[5] = (nb_sectors >> 16) & 0xff; in scsi_disk_emulate_command()
2221 outbuf[6] = (nb_sectors >> 8) & 0xff; in scsi_disk_emulate_command()
2222 outbuf[7] = nb_sectors & 0xff; in scsi_disk_emulate_command()
2402 uint64_t nb_sectors; in scsi_disk_reset() local
2406 blk_get_geometry(s->qdev.conf.blk, &nb_sectors); in scsi_disk_reset()
2408 nb_sectors /= s->qdev.blocksize / BDRV_SECTOR_SIZE; in scsi_disk_reset()
2409 if (nb_sectors) { in scsi_disk_reset()
2410 nb_sectors--; in scsi_disk_reset()
2412 s->qdev.max_lba = nb_sectors; in scsi_disk_reset()