Index: sys/fs/devfs/devfs_vnops.c =================================================================== --- sys/fs/devfs/devfs_vnops.c +++ sys/fs/devfs/devfs_vnops.c @@ -598,8 +598,26 @@ VNPASS(vp->v_usecount == 1, vp); /* Special casing of ttys for deadfs. Probably redundant. */ dsw = dev->si_devsw; - if (dsw != NULL && (dsw->d_flags & D_TTY) != 0) - vp->v_vflag |= VV_ISTTY; + if (dsw != NULL) { + switch (dsw->d_flags & D_TYPEMASK) { + case D_NOTYPE: + case D_TAPE: + break; + case D_DISK: + vp->v_irflag |= VIRF_ISDISK; + break; + case D_TTY: + vp->v_vflag |= VV_ISTTY; + break; + case D_MEM: + break; + default: +#ifdef INVARIANTS + panic("%s: unknown type %d\n", __func__, dsw->d_flags & D_TYPEMASK); +#endif + break; + } + } dev_unlock(); VI_UNLOCK(vp); if ((dev->si_flags & SI_ETERNAL) != 0) Index: sys/kern/vfs_subr.c =================================================================== --- sys/kern/vfs_subr.c +++ sys/kern/vfs_subr.c @@ -3961,7 +3961,9 @@ strlcat(buf, "|VIRF_DOOMED", sizeof(buf)); if (vp->v_irflag & VIRF_PGREAD) strlcat(buf, "|VIRF_PGREAD", sizeof(buf)); - flags = vp->v_irflag & ~(VIRF_DOOMED | VIRF_PGREAD); + if (vp->v_irflag & VIRF_ISDISK) + strlcat(buf, "|VIRF_ISDISK", sizeof(buf)); + flags = vp->v_irflag & ~(VIRF_DOOMED | VIRF_PGREAD | VIRF_ISDISK); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VIRF(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); @@ -5000,14 +5002,6 @@ return (error == 0); } -bool -vn_isdisk(struct vnode *vp) -{ - int error; - - return (vn_isdisk_error(vp, &error)); -} - /* * VOP_FPLOOKUP_VEXEC routines are subject to special circumstances, see * the comment above cache_fplookup for details. Index: sys/sys/conf.h =================================================================== --- sys/sys/conf.h +++ sys/sys/conf.h @@ -142,6 +142,7 @@ /* * Types for d_flags. */ +#define D_NOTYPE 0x0000 #define D_TAPE 0x0001 #define D_DISK 0x0002 #define D_TTY 0x0004 Index: sys/sys/vnode.h =================================================================== --- sys/sys/vnode.h +++ sys/sys/vnode.h @@ -246,6 +246,7 @@ #define VIRF_DOOMED 0x0001 /* This vnode is being recycled */ #define VIRF_PGREAD 0x0002 /* Direct reads from the page cache are permitted, never cleared once set */ +#define VIRF_ISDISK 0x0004 /* This vnode is a disk device */ #define VI_TEXT_REF 0x0001 /* Text ref grabbed use ref */ #define VI_MOUNT 0x0002 /* Mount in progress */ @@ -719,7 +720,11 @@ struct thread *fsize_td); int vn_need_pageq_flush(struct vnode *vp); bool vn_isdisk_error(struct vnode *vp, int *errp); -bool vn_isdisk(struct vnode *vp); +static inline bool +vn_isdisk(struct vnode *vp) +{ + return ((vp->v_irflag & VIRF_ISDISK) != 0); +} int _vn_lock(struct vnode *vp, int flags, const char *file, int line); #define vn_lock(vp, flags) _vn_lock(vp, flags, __FILE__, __LINE__) int vn_open(struct nameidata *ndp, int *flagp, int cmode, struct file *fp);