ata_da: set disk::d_ident from serial number

Andriy Gapon avg at FreeBSD.org
Sat Sep 22 17:15:40 UTC 2012


I would like to get the following change into ata_da:

commit 19c0fcb7b28c33b34b0b72e19fccb7bb0a195cd8
Author: Andriy Gapon <avg at icyb.net.ua>
Date:   Tue Sep 4 18:36:00 2012 +0300

    ata_da: set disk::d_ident from serial number

diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
index 08c756e..92ed0c6 100644
--- a/sys/cam/ata/ata_da.c
+++ b/sys/cam/ata/ata_da.c
@@ -1064,6 +1064,8 @@ adaregister(struct cam_periph *periph, void *arg)
 		softc->disk->d_flags |= DISKFLAG_CANDELETE;
 	strlcpy(softc->disk->d_descr, cgd->ident_data.model,
 	    MIN(sizeof(softc->disk->d_descr), sizeof(cgd->ident_data.model)));
+	strlcpy(softc->disk->d_ident, cgd->ident_data.serial,
+	    MIN(sizeof(softc->disk->d_ident), sizeof(cgd->ident_data.serial)));
 	softc->disk->d_hba_vendor = cpi.hba_vendor;
 	softc->disk->d_hba_device = cpi.hba_device;
 	softc->disk->d_hba_subvendor = cpi.hba_subvendor;

-- 
Andriy Gapon


More information about the freebsd-scsi mailing list