From owner-svn-soc-all@FreeBSD.ORG Mon Sep 9 14:23:55 2013 Return-Path: Delivered-To: svn-soc-all@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 251597F9 for ; Mon, 9 Sep 2013 14:23:55 +0000 (UTC) (envelope-from zcore@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1110F29F2 for ; Mon, 9 Sep 2013 14:23:55 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89ENsr9004894 for ; Mon, 9 Sep 2013 14:23:54 GMT (envelope-from zcore@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r89ENs3i004884 for svn-soc-all@FreeBSD.org; Mon, 9 Sep 2013 14:23:54 GMT (envelope-from zcore@FreeBSD.org) Date: Mon, 9 Sep 2013 14:23:54 GMT Message-Id: <201309091423.r89ENs3i004884@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to zcore@FreeBSD.org using -f From: zcore@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257157 - soc2013/zcore/head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2013 14:23:55 -0000 Author: zcore Date: Mon Sep 9 14:23:54 2013 New Revision: 257157 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257157 Log: add blockif_fsync and call it in handle_flush() path Modified: soc2013/zcore/head/usr.sbin/bhyve/block_if.c soc2013/zcore/head/usr.sbin/bhyve/block_if.h soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Modified: soc2013/zcore/head/usr.sbin/bhyve/block_if.c ============================================================================== --- soc2013/zcore/head/usr.sbin/bhyve/block_if.c Mon Sep 9 13:56:58 2013 (r257156) +++ soc2013/zcore/head/usr.sbin/bhyve/block_if.c Mon Sep 9 14:23:54 2013 (r257157) @@ -335,6 +335,14 @@ return (0); } +int +blockif_fsync(struct blockif_ctxt *bc) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + return fsync(bc->bc_fd); +} + /* * Accessors */ Modified: soc2013/zcore/head/usr.sbin/bhyve/block_if.h ============================================================================== --- soc2013/zcore/head/usr.sbin/bhyve/block_if.h Mon Sep 9 13:56:58 2013 (r257156) +++ soc2013/zcore/head/usr.sbin/bhyve/block_if.h Mon Sep 9 14:23:54 2013 (r257157) @@ -54,5 +54,6 @@ int blockif_write(struct blockif_ctxt *bc, struct blockif_req *breq); int blockif_cancel(struct blockif_ctxt *bc, struct blockif_req *breq); int blockif_close(struct blockif_ctxt *bc); +int blockif_fsync(struct blockif_ctxt *bc); #endif /* _BLOCK_IF_H_ */ Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Mon Sep 9 13:56:58 2013 (r257156) +++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Mon Sep 9 14:23:54 2013 (r257157) @@ -428,6 +428,7 @@ pthread_cond_wait(&p->flush_cond, &sc->mtx); p->flush_pending = 0; } + blockif_fsync(p->bctx); ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); }