svn commit: r304178 - in head/sys: fs/msdosfs kern sys
Konstantin Belousov
kib at FreeBSD.org
Mon Aug 15 19:17:02 UTC 2016
Author: kib
Date: Mon Aug 15 19:17:00 2016
New Revision: 304178
URL: https://svnweb.freebsd.org/changeset/base/304178
Log:
Implement VOP_FDATASYNC() for msdosfs.
Standard VOP_FSYNC() implementation just syncs data buffers, and due
to this, is the correct and efficient implementation for msdosfs or
any other filesystem which uses bufer cache trivially. Provide
globally visible wrapper vop_stdfdatasync_buf() for future consumption
by other filesystems.
Reviewed by: mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D7471
Modified:
head/sys/fs/msdosfs/msdosfs_vnops.c
head/sys/kern/vfs_default.c
head/sys/sys/vnode.h
Modified: head/sys/fs/msdosfs/msdosfs_vnops.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_vnops.c Mon Aug 15 19:15:46 2016 (r304177)
+++ head/sys/fs/msdosfs/msdosfs_vnops.c Mon Aug 15 19:17:00 2016 (r304178)
@@ -1897,6 +1897,7 @@ struct vop_vector msdosfs_vnodeops = {
.vop_close = msdosfs_close,
.vop_create = msdosfs_create,
.vop_fsync = msdosfs_fsync,
+ .vop_fdatasync = vop_stdfdatasync_buf,
.vop_getattr = msdosfs_getattr,
.vop_inactive = msdosfs_inactive,
.vop_link = msdosfs_link,
Modified: head/sys/kern/vfs_default.c
==============================================================================
--- head/sys/kern/vfs_default.c Mon Aug 15 19:15:46 2016 (r304177)
+++ head/sys/kern/vfs_default.c Mon Aug 15 19:17:00 2016 (r304178)
@@ -735,6 +735,17 @@ vop_stdfdatasync(struct vop_fdatasync_ar
return (VOP_FSYNC(ap->a_vp, MNT_WAIT, ap->a_td));
}
+int
+vop_stdfdatasync_buf(struct vop_fdatasync_args *ap)
+{
+ struct vop_fsync_args apf;
+
+ apf.a_vp = ap->a_vp;
+ apf.a_waitfor = MNT_WAIT;
+ apf.a_td = ap->a_td;
+ return (vop_stdfsync(&apf));
+}
+
/* XXX Needs good comment and more info in the manpage (VOP_GETPAGES(9)). */
int
vop_stdgetpages(ap)
Modified: head/sys/sys/vnode.h
==============================================================================
--- head/sys/sys/vnode.h Mon Aug 15 19:15:46 2016 (r304177)
+++ head/sys/sys/vnode.h Mon Aug 15 19:17:00 2016 (r304178)
@@ -720,6 +720,7 @@ int vfs_write_suspend(struct mount *mp,
int vfs_write_suspend_umnt(struct mount *mp);
void vnlru_free(int, struct vfsops *);
int vop_stdbmap(struct vop_bmap_args *);
+int vop_stdfdatasync_buf(struct vop_fdatasync_args *);
int vop_stdfsync(struct vop_fsync_args *);
int vop_stdgetwritemount(struct vop_getwritemount_args *);
int vop_stdgetpages(struct vop_getpages_args *);
More information about the svn-src-head
mailing list