diff options
author | phk <phk@FreeBSD.org> | 1999-11-22 10:33:55 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-11-22 10:33:55 +0000 |
commit | 1848d96439c3eae03af8c379d699cf530ec39611 (patch) | |
tree | 0dd64726856780468e173aa94cbba55946f1b4cf /sys/kern/vfs_subr.c | |
parent | 9fac48d9a6cd7258b469d97bb694c7e34d7d8e39 (diff) | |
download | FreeBSD-src-1848d96439c3eae03af8c379d699cf530ec39611.zip FreeBSD-src-1848d96439c3eae03af8c379d699cf530ec39611.tar.gz |
Convert various pieces of code to use vn_isdisk() rather than checking
for vp->v_type == VBLK.
In ccd: we don't need to call VOP_GETATTR to find the type of a vnode.
Reviewed by: sos
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index fc850ff..1b0494e 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1021,7 +1021,7 @@ sched_sync(void) * slot we are safe. */ if (TAILQ_EMPTY(&vp->v_dirtyblkhd) && - vp->v_type != VBLK) + !vn_isdisk(vp)) panic("sched_sync: fsync failed vp %p tag %d", vp, vp->v_tag); /* * Put us back on the worklist. The worklist @@ -1207,6 +1207,7 @@ reassignbuf(bp, newvp) case VDIR: delay = dirdelay; break; + case VCHR: case VBLK: if (newvp->v_specmountpoint != NULL) { delay = metadelay; @@ -2507,7 +2508,7 @@ vfs_object_create(vp, p, cred) vm_object_t object; int error = 0; - if (vp->v_type != VBLK && vn_canvmio(vp) == FALSE) + if (!vn_isdisk(vp) && vn_canvmio(vp) == FALSE) return 0; retry: @@ -2519,7 +2520,7 @@ retry: } else if (devsw(vp->v_rdev) != NULL) { /* * This simply allocates the biggest object possible - * for a VBLK vnode. This should be fixed, but doesn't + * for a disk vnode. This should be fixed, but doesn't * cause any problems (yet). */ object = vnode_pager_alloc(vp, IDX_TO_OFF(INT_MAX), 0, 0); |