From owner-svn-src-all@freebsd.org Sat Apr 1 17:15:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2F06D29E4E; Sat, 1 Apr 2017 17:15:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74701E3C; Sat, 1 Apr 2017 17:15:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v31HFrFK079594; Sat, 1 Apr 2017 17:15:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31HFrXR079593; Sat, 1 Apr 2017 17:15:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201704011715.v31HFrXR079593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 1 Apr 2017 17:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316366 - stable/11/sys/fs/devfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 17:15:54 -0000 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,