summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi.c
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2022-03-02 00:35:50 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2022-05-02 16:59:11 -0400
commite60ac0b9e445822e60230c00e68d8cdb7748701b (patch)
tree75b122b19e4922541670042bf29c46a69a47f5c6 /drivers/scsi/scsi.c
parente17d63403076affccd72d195f93bbf3f39514005 (diff)
scsi: core: Cache VPD pages b0, b1, b2
The SCSI disk driver consults VPD pages b0 (Block Limits), b1 (Block Device Characteristics), and b2 (Logical Block Provisioning). Instead of having sd.c request these pages every revalidate cycle, cache them along with the other commonly used VPDs. Link: https://lore.kernel.org/r/20220302053559.32147-6-martin.petersen@oracle.com Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi.c')
-rw-r--r--drivers/scsi/scsi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 3db2a928faec..c59eac7a32f2 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -483,6 +483,12 @@ void scsi_attach_vpd(struct scsi_device *sdev)
scsi_update_vpd_page(sdev, 0x83, &sdev->vpd_pg83);
if (vpd_buf->data[i] == 0x89)
scsi_update_vpd_page(sdev, 0x89, &sdev->vpd_pg89);
+ if (vpd_buf->data[i] == 0xb0)
+ scsi_update_vpd_page(sdev, 0xb0, &sdev->vpd_pgb0);
+ if (vpd_buf->data[i] == 0xb1)
+ scsi_update_vpd_page(sdev, 0xb1, &sdev->vpd_pgb1);
+ if (vpd_buf->data[i] == 0xb2)
+ scsi_update_vpd_page(sdev, 0xb2, &sdev->vpd_pgb2);
}
kfree(vpd_buf);
}