From owner-svn-src-stable@FreeBSD.ORG Sat Sep 14 09:34:26 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B2FB5403; Sat, 14 Sep 2013 09:34:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 912702C05; Sat, 14 Sep 2013 09:34:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E9YQVd010206; Sat, 14 Sep 2013 09:34:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E9YQPA010204; Sat, 14 Sep 2013 09:34:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201309140934.r8E9YQPA010204@svn.freebsd.org> From: Alexander Motin Date: Sat, 14 Sep 2013 09:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255552 - in stable/9/sys/cam: ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2013 09:34:26 -0000 Author: mav Date: Sat Sep 14 09:34:25 2013 New Revision: 255552 URL: http://svnweb.freebsd.org/changeset/base/255552 Log: MFC r249981: Remove ADA_FLAG_PACK_INVALID flag. Since ATA disks have no concept of media change it only duplicates CAM_PERIPH_INVALID flag, so we can use last one. Slightly cleanup DA_FLAG_PACK_INVALID use. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Sat Sep 14 09:24:40 2013 (r255551) +++ stable/9/sys/cam/ata/ata_da.c Sat Sep 14 09:34:25 2013 (r255552) @@ -76,7 +76,6 @@ typedef enum { } ada_state; typedef enum { - ADA_FLAG_PACK_INVALID = 0x0001, ADA_FLAG_CAN_48BIT = 0x0002, ADA_FLAG_CAN_FLUSHCACHE = 0x0004, ADA_FLAG_CAN_NCQ = 0x0008, @@ -592,16 +591,11 @@ adaopen(struct disk *dp) return (error); } - softc = (struct ada_softc *)periph->softc; - softc->flags |= ADA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, ("adaopen\n")); - if ((softc->flags & ADA_FLAG_PACK_INVALID) != 0) { - /* Invalidate our pack information. */ - softc->flags &= ~ADA_FLAG_PACK_INVALID; - } + softc = (struct ada_softc *)periph->softc; + softc->flags |= ADA_FLAG_OPEN; cam_periph_unhold(periph); cam_periph_unlock(periph); @@ -632,7 +626,7 @@ adaclose(struct disk *dp) /* We only sync the cache if the drive is capable of it. */ if ((softc->flags & ADA_FLAG_DIRTY) != 0 && (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && - (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { + (periph->flags & CAM_PERIPH_INVALID) == 0) { ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); cam_fill_ataio(&ccb->ataio, @@ -709,7 +703,7 @@ adastrategy(struct bio *bp) /* * If the device has been made invalid, error out */ - if ((softc->flags & ADA_FLAG_PACK_INVALID)) { + if ((periph->flags & CAM_PERIPH_INVALID) != 0) { cam_periph_unlock(periph); biofinish(bp, NULL, ENXIO); return; @@ -760,7 +754,7 @@ adadump(void *arg, void *virtual, vm_off lba = offset / secsize; count = length / secsize; - if ((softc->flags & ADA_FLAG_PACK_INVALID) != 0) { + if ((periph->flags & CAM_PERIPH_INVALID) != 0) { cam_periph_unlock(periph); return (ENXIO); } @@ -885,8 +879,6 @@ adaoninvalidate(struct cam_periph *perip */ xpt_register_async(0, adaasync, periph, periph->path); - softc->flags |= ADA_FLAG_PACK_INVALID; - /* * Return all queued I/O with ENXIO. * XXX Handle any transactions queued to the card @@ -1050,7 +1042,7 @@ adasysctlinit(void *context, int pending periph = (struct cam_periph *)context; /* periph was held for us when this task was enqueued */ - if (periph->flags & CAM_PERIPH_INVALID) { + if ((periph->flags & CAM_PERIPH_INVALID) != 0) { cam_periph_release(periph); return; } @@ -1664,7 +1656,7 @@ out: case ADA_STATE_RAHEAD: case ADA_STATE_WCACHE: { - if (softc->flags & ADA_FLAG_PACK_INVALID) { + if ((periph->flags & CAM_PERIPH_INVALID) != 0) { softc->state = ADA_STATE_NORMAL; xpt_release_ccb(start_ccb); cam_release_devq(periph->path, @@ -1726,20 +1718,6 @@ adadone(struct cam_periph *periph, union return; } if (error != 0) { - if (error == ENXIO && - (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { - /* - * Catastrophic error. Mark our pack as - * invalid. - */ - /* - * XXX See if this is really a media - * XXX change first? - */ - xpt_print(periph->path, - "Invalidating pack\n"); - softc->flags |= ADA_FLAG_PACK_INVALID; - } bp->bio_error = error; bp->bio_resid = bp->bio_bcount; bp->bio_flags |= BIO_ERROR; Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Sat Sep 14 09:24:40 2013 (r255551) +++ stable/9/sys/cam/scsi/scsi_da.c Sat Sep 14 09:34:25 2013 (r255552) @@ -1194,7 +1194,6 @@ daopen(struct disk *dp) { struct cam_periph *periph; struct da_softc *softc; - int unit; int error; periph = (struct cam_periph *)dp->d_drv1; @@ -1209,17 +1208,12 @@ daopen(struct disk *dp) return (error); } - unit = periph->unit_number; - softc = (struct da_softc *)periph->softc; - softc->flags |= DA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, ("daopen\n")); - if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) { - /* Invalidate our pack information. */ - softc->flags &= ~DA_FLAG_PACK_INVALID; - } + softc = (struct da_softc *)periph->softc; + softc->flags |= DA_FLAG_OPEN; + softc->flags &= ~DA_FLAG_PACK_INVALID; dareprobe(periph); @@ -2976,11 +2970,6 @@ dadone(struct cam_periph *periph, union if (softc->outstanding_cmds == 0) softc->flags |= DA_FLAG_WENT_IDLE; - if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) { - xpt_print(periph->path, "oustanding %d\n", - softc->outstanding_cmds); - } - if (state == DA_CCB_DELETE) { while ((bp1 = bioq_takefirst(&softc->delete_run_queue)) != NULL) {