fifo: minor comment and assert improvements.

In particular, replace a note that reload through vget() is obsoleted,
with explanation why this code is required.

Reviewed by:	chs, mckusick
Tested by:	pho
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Konstantin Belousov 2021-02-01 12:43:16 +02:00
parent 26af9f72f7
commit adf28ab456
2 changed files with 6 additions and 4 deletions

View File

@ -1183,7 +1183,8 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
* vnode operations here.
*/
if (fp->f_ops == &badfileops) {
KASSERT(vp->v_type != VFIFO, ("Unexpected fifo."));
KASSERT(vp->v_type != VFIFO,
("Unexpected fifo fp %p vp %p", fp, vp));
finit_vnode(fp, flags, NULL, &vnops);
}

View File

@ -252,9 +252,10 @@ ufs_mknod(ap)
DIP_SET(ip, i_rdev, vap->va_rdev);
}
/*
* Remove inode, then reload it through VFS_VGET so it is
* checked to see if it is an alias of an existing entry in
* the inode cache. XXX I don't believe this is necessary now.
* Remove inode, then reload it through VFS_VGET(). This is
* needed to do further inode initialization, for instance
* fifo, which was too early for VFS_VGET() done as part of
* UFS_VALLOC().
*/
(*vpp)->v_type = VNON;
ino = ip->i_number; /* Save this before vgone() invalidates ip. */