Module Name:    src
Committed By:   gdt
Date:           Sun Nov  3 14:00:52 UTC 2024

Modified Files:
        src/external/cddl/osnet/dist/uts/common/fs/zfs: zvol.c

Log Message:
zvol: Implement DIOCCACHESYNC

Similarly to FreeBSD, simply call zil_commit when the DIOCCACHESYNC
ioctl is invoked on a zvol.

Tested in a xen dom0 with a domU's xbds provided by zvol on dom0.  The
error message about DIOCCACHESYNC is gone, and (mysteriously)
operations in the domU seem faster.

Thanks to Michael van Elst via port-xen@ for pointing out where/how to
do this.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
    src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c:1.13 src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c:1.14
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c:1.13	Sat Feb 29 17:03:33 2020
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c	Sun Nov  3 14:00:52 2024
@@ -3594,6 +3594,10 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t 
 	error = 0;
 
 	switch(cmd) {
+	case DIOCCACHESYNC:
+		zil_commit(zv->zv_zilog, ZVOL_OBJ);
+		break;
+
 	case DIOCGWEDGEINFO:
 	{
 		struct dkwedge_info *dkw = (void *) arg;

Reply via email to