FreeBSD/sys/fs/pseudofs/pseudofs_vnops.c
/*
 * Open a file or directory.
 */
Open a file or directory.
Open a file or directory .
static int
pfs_open(struct vop_open_args *va)
{
	struct vnode *vn = va->a_vp;
	struct pfs_vdata *pvd = vn->v_data;
	struct pfs_node *pn = pvd->pvd_pn;
	int mode = va->a_mode;
	PFS_TRACE(("%s (mode 0x%x)", pn->pn_name, mode));
	pfs_assert_not_owned(pn);
	if (((mode & FREAD) && !(mode & PFS_RD)) ||
	    ((mode & FWRITE) && !(mode & PFS_WR)))
		PFS_RETURN (EPERM);
	if ((mode & O_SHLOCK) || (mode & O_EXLOCK))
		PFS_RETURN (EOPNOTSUPP);
	PFS_RETURN (0);
}
static int pfs_open ( struct vop_open_args * va ) { struct vnode * vn = va -> a_vp ; struct pfs_vdata * pvd = vn -> v_data ; struct pfs_node * pn = pvd -> pvd_pn ; int mode = va -> a_mode ; PFS_TRACE ( ( " " , pn -> pn_name , mode ) ) ; pfs_assert_not_owned ( pn ) ; if ( ( ( mode & FREAD ) && ! ( mode & PFS_RD ) ) || ( ( mode & FWRITE ) && ! ( mode & PFS_WR ) ) ) PFS_RETURN ( EPERM ) ; if ( ( mode & O_SHLOCK ) || ( mode & O_EXLOCK ) ) PFS_RETURN ( EOPNOTSUPP ) ; PFS_RETURN ( 0 ) ; }
Open a file or directory.
Open a file or directory .
/* check if the requested mode is permitted */ /* we don't support locking */