Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Nov 2014 19:40:21 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r274811 - user/marcel/libvdsk/libvdsk
Message-ID:  <201411211940.sALJeLLH066310@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Fri Nov 21 19:40:21 2014
New Revision: 274811
URL: https://svnweb.freebsd.org/changeset/base/274811

Log:
  Implement vdsk_flush() as is done in pci_virtio_block.c.

Modified:
  user/marcel/libvdsk/libvdsk/vdsk.c

Modified: user/marcel/libvdsk/libvdsk/vdsk.c
==============================================================================
--- user/marcel/libvdsk/libvdsk/vdsk.c	Fri Nov 21 19:19:27 2014	(r274810)
+++ user/marcel/libvdsk/libvdsk/vdsk.c	Fri Nov 21 19:40:21 2014	(r274811)
@@ -155,9 +155,12 @@ vdsk_writev(vdskctx ctx, const struct io
 }
 
 int
-vdsk_flush(vdskctx ctx __unused)
+vdsk_flush(vdskctx ctx)
 {
+	struct vdsk *vdsk = vdsk_deref(ctx);
+	int res;
 
-	return (0);
+	res = fsync(vdsk->fd);
+	return ((res == -1) ? errno : 0);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411211940.sALJeLLH066310>