Date: Thu, 5 Nov 2015 16:50:09 +0000 (UTC) From: Steven Hartland <smh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290396 - stable/10/sys/kern Message-ID: <201511051650.tA5Go93R053647@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: smh Date: Thu Nov 5 16:50:09 2015 New Revision: 290396 URL: https://svnweb.freebsd.org/changeset/base/290396 Log: MFC r273118 (by mjg) Don't take devmtx unnecessarily in vn_isdisk. Sponsored by: Multiplay Modified: stable/10/sys/kern/vfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Thu Nov 5 16:08:38 2015 (r290395) +++ stable/10/sys/kern/vfs_subr.c Thu Nov 5 16:50:09 2015 (r290396) @@ -3836,17 +3836,20 @@ vn_isdisk(struct vnode *vp, int *errp) { int error; + if (vp->v_type != VCHR) { + error = ENOTBLK; + goto out; + } error = 0; dev_lock(); - if (vp->v_type != VCHR) - error = ENOTBLK; - else if (vp->v_rdev == NULL) + if (vp->v_rdev == NULL) error = ENXIO; else if (vp->v_rdev->si_devsw == NULL) error = ENXIO; else if (!(vp->v_rdev->si_devsw->d_flags & D_DISK)) error = ENOTBLK; dev_unlock(); +out: if (errp != NULL) *errp = error; return (error == 0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511051650.tA5Go93R053647>