From owner-svn-src-head@freebsd.org Wed Dec 13 07:07:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BC11E93829; Wed, 13 Dec 2017 07:07:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9E7A6508D; Wed, 13 Dec 2017 07:07:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBD77Sbb017906; Wed, 13 Dec 2017 07:07:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBD77S3o017905; Wed, 13 Dec 2017 07:07:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712130707.vBD77S3o017905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 Dec 2017 07:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326819 - head/sys/cam/ata X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/ata X-SVN-Commit-Revision: 326819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2017 07:07:29 -0000 Author: imp Date: Wed Dec 13 07:07:27 2017 New Revision: 326819 URL: https://svnweb.freebsd.org/changeset/base/326819 Log: Use ataio ccb instead of general ccb to avoid excessice stack usage. Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Wed Dec 13 06:20:18 2017 (r326818) +++ head/sys/cam/ata/ata_da.c Wed Dec 13 07:07:27 2017 (r326819) @@ -1048,7 +1048,7 @@ adadump(void *arg, void *virtual, vm_offset_t physical struct cam_periph *periph; struct ada_softc *softc; u_int secsize; - union ccb ccb; + struct ccb_ataio ataio; struct disk *dp; uint64_t lba; uint16_t count; @@ -1067,11 +1067,11 @@ adadump(void *arg, void *virtual, vm_offset_t physical return (ENXIO); } - memset(&ccb, 0, sizeof(ccb)); + memset(&ataio, 0, sizeof(ataio)); if (length > 0) { - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - ccb.ccb_h.ccb_state = ADA_CCB_DUMP; - cam_fill_ataio(&ccb.ataio, + xpt_setup_ccb(&ataio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + ataio.ccb_h.ccb_state = ADA_CCB_DUMP; + cam_fill_ataio(&ataio, 0, adadone, CAM_DIR_OUT, @@ -1082,13 +1082,13 @@ adadump(void *arg, void *virtual, vm_offset_t physical if ((softc->flags & ADA_FLAG_CAN_48BIT) && (lba + count >= ATA_MAX_28BIT_LBA || count >= 256)) { - ata_48bit_cmd(&ccb.ataio, ATA_WRITE_DMA48, + ata_48bit_cmd(&ataio, ATA_WRITE_DMA48, 0, lba, count); } else { - ata_28bit_cmd(&ccb.ataio, ATA_WRITE_DMA, + ata_28bit_cmd(&ataio, ATA_WRITE_DMA, 0, lba, count); } - error = cam_periph_runccb(&ccb, adaerror, + error = cam_periph_runccb((union ccb *)&ataio, adaerror, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) printf("Aborting dump due to I/O error.\n"); @@ -1098,15 +1098,15 @@ adadump(void *arg, void *virtual, vm_offset_t physical } if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) { - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&ataio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); /* * Tell the drive to flush its internal cache. if we * can't flush in 5s we have big problems. No need to * wait the default 60s to detect problems. */ - ccb.ccb_h.ccb_state = ADA_CCB_DUMP; - cam_fill_ataio(&ccb.ataio, + ataio.ccb_h.ccb_state = ADA_CCB_DUMP; + cam_fill_ataio(&ataio, 0, adadone, CAM_DIR_NONE, @@ -1116,10 +1116,10 @@ adadump(void *arg, void *virtual, vm_offset_t physical 5*1000); if (softc->flags & ADA_FLAG_CAN_48BIT) - ata_48bit_cmd(&ccb.ataio, ATA_FLUSHCACHE48, 0, 0, 0); + ata_48bit_cmd(&ataio, ATA_FLUSHCACHE48, 0, 0, 0); else - ata_28bit_cmd(&ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0); - error = cam_periph_runccb(&ccb, adaerror, + ata_28bit_cmd(&ataio, ATA_FLUSHCACHE, 0, 0, 0); + error = cam_periph_runccb((union ccb *)&ataio, adaerror, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) xpt_print(periph->path, "Synchronize cache failed\n");