svn commit: r316366 - stable/11/sys/fs/devfs
Edward Tomasz Napierala
trasz at FreeBSD.org
Sat Apr 1 17:15:54 UTC 2017
Author: trasz
Date: Sat Apr 1 17:15:53 2017
New Revision: 316366
URL: https://svnweb.freebsd.org/changeset/base/316366
Log:
MFC r313994:
Simplify devfs_fsync() by removing it. This might also be a minor
optimization, as vn_isdisk() needs to lock a global mutex.
Sponsored by: DARPA, AFRL
Modified:
stable/11/sys/fs/devfs/devfs_vnops.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- stable/11/sys/fs/devfs/devfs_vnops.c Sat Apr 1 17:13:00 2017 (r316365)
+++ stable/11/sys/fs/devfs/devfs_vnops.c Sat Apr 1 17:15:53 2017 (r316366)
@@ -677,32 +677,6 @@ devfs_close_f(struct file *fp, struct th
}
static int
-devfs_fsync(struct vop_fsync_args *ap)
-{
- int error;
- struct bufobj *bo;
- struct devfs_dirent *de;
-
- if (!vn_isdisk(ap->a_vp, &error)) {
- bo = &ap->a_vp->v_bufobj;
- de = ap->a_vp->v_data;
- if (error == ENXIO && bo->bo_dirty.bv_cnt > 0) {
- printf("Device %s went missing before all of the data "
- "could be written to it; expect data loss.\n",
- de->de_dirent->d_name);
-
- error = vop_stdfsync(ap);
- if (bo->bo_dirty.bv_cnt != 0 || error != 0)
- printf("devfs_fsync: vop_stdfsync failed.");
- }
-
- return (0);
- }
-
- return (vop_stdfsync(ap));
-}
-
-static int
devfs_getattr(struct vop_getattr_args *ap)
{
struct vnode *vp = ap->a_vp;
@@ -1896,7 +1870,7 @@ static struct vop_vector devfs_specops =
.vop_bmap = VOP_PANIC,
.vop_close = devfs_close,
.vop_create = VOP_PANIC,
- .vop_fsync = devfs_fsync,
+ .vop_fsync = vop_stdfsync,
.vop_getattr = devfs_getattr,
.vop_link = VOP_PANIC,
.vop_mkdir = VOP_PANIC,
More information about the svn-src-stable-11
mailing list