FreeBSD/sys/fs/nfsclient/nfs_clvnops.c
/*
 * Close wrapper for fifos.
 *
 * Update the times on the nfsnode then do fifo close.
 */
Close wrapper for fifos.
Update the times on the nfsnode then do fifo close.
Close wrapper for fifos . Update the times on the nfsnode then do fifo close .
static int
nfsfifo_close(struct vop_close_args *ap)
{
	struct vnode *vp = ap->a_vp;
	struct nfsnode *np = VTONFS(vp);
	struct vattr vattr;
	struct timespec ts;
	mtx_lock(&np->n_mtx);
	if (np->n_flag & (NACC | NUPD)) {
		vfs_timestamp(&ts);
		if (np->n_flag & NACC)
			np->n_atim = ts;
		if (np->n_flag & NUPD)
			np->n_mtim = ts;
		np->n_flag |= NCHG;
		if (vrefcnt(vp) == 1 &&
		    (vp->v_mount->mnt_flag & MNT_RDONLY) == 0) {
			VATTR_NULL(&vattr);
			if (np->n_flag & NACC)
				vattr.va_atime = np->n_atim;
			if (np->n_flag & NUPD)
				vattr.va_mtime = np->n_mtim;
			mtx_unlock(&np->n_mtx);
			(void)VOP_SETATTR(vp, &vattr, ap->a_cred);
			goto out;
		}
	}
	mtx_unlock(&np->n_mtx);
out:
	return (fifo_specops.vop_close(ap));
}
static int nfsfifo_close ( struct vop_close_args * ap ) { struct vnode * vp = ap -> a_vp ; struct nfsnode * np = VTONFS ( vp ) ; struct vattr vattr ; struct timespec ts ; mtx_lock ( & np -> n_mtx ) ; if ( np -> n_flag & ( NACC | NUPD ) ) { vfs_timestamp ( & ts ) ; if ( np -> n_flag & NACC ) np -> n_atim = ts ; if ( np -> n_flag & NUPD ) np -> n_mtim = ts ; np -> n_flag |= NCHG ; if ( vrefcnt ( vp ) == 1 && ( vp -> v_mount -> mnt_flag & MNT_RDONLY ) == 0 ) { VATTR_NULL ( & vattr ) ; if ( np -> n_flag & NACC ) vattr . va_atime = np -> n_atim ; if ( np -> n_flag & NUPD ) vattr . va_mtime = np -> n_mtim ; mtx_unlock ( & np -> n_mtx ) ; ( void ) VOP_SETATTR ( vp , & vattr , ap -> a_cred ) ; goto out ; } } mtx_unlock ( & np -> n_mtx ) ; out : return ( fifo_specops . vop_close ( ap ) ) ; }
Close wrapper for fifos.
Close wrapper for fifos .