da: Update trim stats for WRITE SAME and ATA TRIM

The scsi UNMAP path updated trim stats in the da sysctl, but the ATA
TRIM passthru and WRITE SAME paths did not. Add code so they do.

PR: 277637
Reviewed by: imp (tweaked WS path to update ranges)
This commit is contained in:
Matthew Grooms 2024-05-03 08:41:05 -06:00 committed by Warner Losh
parent 0c0146c309
commit 12117d0e93

View file

@ -4208,6 +4208,9 @@ da_delete_trim(struct cam_periph *periph, union ccb *ccb, struct bio *bp)
da_default_timeout * 1000);
ccb->ccb_h.ccb_state = DA_CCB_DELETE;
ccb->ccb_h.flags |= CAM_UNLOCKED;
softc->trim_count++;
softc->trim_ranges += ranges;
softc->trim_lbas += block_count;
cam_iosched_submit_trim(softc->cam_iosched);
}
@ -4268,6 +4271,9 @@ da_delete_ws(struct cam_periph *periph, union ccb *ccb, struct bio *bp)
da_default_timeout * 1000);
ccb->ccb_h.ccb_state = DA_CCB_DELETE;
ccb->ccb_h.flags |= CAM_UNLOCKED;
softc->trim_count++;
softc->trim_ranges++;
softc->trim_lbas += count;
cam_iosched_submit_trim(softc->cam_iosched);
}