Skip to content

Commit

Permalink
Merge pull request #585 from mikechristie/fix-unmap-max-len
Browse files Browse the repository at this point in the history
Fix man unmap len reporting
  • Loading branch information
mikechristie authored Aug 6, 2019
2 parents cd6882c + 6826cb0 commit e8cbb9c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ int tcmu_emulate_evpd_inquiry(
{
char data[64];
uint32_t max_xfer_length;
uint32_t opt_unmap_gran;
uint32_t unmap_gran_align;
uint16_t val16;
uint32_t val32;
Expand Down Expand Up @@ -363,16 +362,15 @@ int tcmu_emulate_evpd_inquiry(

if (tcmu_dev_get_unmap_enabled(dev)) {
/* MAXIMUM UNMAP LBA COUNT */
val32 = htobe32(VPD_MAX_UNMAP_LBA_COUNT);
val32 = htobe32(tcmu_dev_get_max_unmap_len(dev));
memcpy(&data[20], &val32, 4);

/* MAXIMUM UNMAP BLOCK DESCRIPTOR COUNT */
val32 = htobe32(VPD_MAX_UNMAP_BLOCK_DESC_COUNT);
memcpy(&data[24], &val32, 4);

/* OPTIMAL UNMAP GRANULARITY */
opt_unmap_gran = tcmu_dev_get_opt_unmap_gran(dev);
val32 = htobe32(opt_unmap_gran);
val32 = htobe32(tcmu_dev_get_opt_unmap_gran(dev));
memcpy(&data[28], &val32, 4);

/* UNMAP GRANULARITY ALIGNMENT */
Expand Down

0 comments on commit e8cbb9c

Please sign in to comment.