From owner-cvs-src@FreeBSD.ORG Sun Dec 16 21:26:14 2007 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33F5416A421; Sun, 16 Dec 2007 21:26:14 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id BC89913C47E; Sun, 16 Dec 2007 21:26:13 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 9DE5F17104; Sun, 16 Dec 2007 21:26:12 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.2/8.14.2) with ESMTP id lBGLQCvs007132; Sun, 16 Dec 2007 21:26:12 GMT (envelope-from phk@critter.freebsd.dk) To: "Bruce M. Simpson" From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 16 Dec 2007 21:22:06 GMT." <476596FE.1090502@FreeBSD.org> Date: Sun, 16 Dec 2007 21:26:12 +0000 Message-ID: <7131.1197840372@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sbin/atacontrol atacontrol.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Dec 2007 21:26:14 -0000 In message <476596FE.1090502@FreeBSD.org>, "Bruce M. Simpson" writes: >> Modified files: >> sbin/atacontrol atacontrol.c >> Log: >> Recognize CFA devices using either identification method. > >Does this give the ata driver a means of identifying that a disk device >is actually a CompactFlash device? I have the attached patch in sos@ mailbox for approval, that adds BIO_DELETE support for the ata driver. I also want to implement a -E option to fsck(8) to erase all unallocated blocks. And finally the big item: msdosfs and ufs support to issue BIO_DELETE when files are deleted. UFS is nasty because of soft-updates. Poul-Henning Index: ata-disk.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/ata-disk.c,v retrieving revision 1.205 diff -u -r1.205 ata-disk.c --- ata-disk.c 23 Nov 2007 08:17:14 -0000 1.205 +++ ata-disk.c 16 Dec 2007 21:22:03 -0000 @@ -162,6 +162,9 @@ adp->disk->d_unit = device_get_unit(dev); if (atadev->param.support.command2 & ATA_SUPPORT_FLUSHCACHE) adp->disk->d_flags = DISKFLAG_CANFLUSHCACHE; + if ((atadev->param.support.command2 & ATA_SUPPORT_CFA) || + atadev->param.config == ATA_PROTO_CFA) + adp->disk->d_flags = DISKFLAG_CANDELETE; snprintf(adp->disk->d_ident, sizeof(adp->disk->d_ident), "ad:%s", atadev->param.serial); disk_create(adp->disk, DISK_VERSION); @@ -274,6 +277,12 @@ else request->u.ata.command = ATA_WRITE; break; + case BIO_DELETE: + request->flags = ATA_R_CONTROL; + request->u.ata.command = ATA_CFA_ERASE; + request->transfersize = 0; + request->donecount = bp->bio_bcount; + break; case BIO_FLUSH: request->u.ata.lba = 0; request->u.ata.count = 0; -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.