FreeBSD/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
/*
 * gfs_get_parent_ino: used to obtain a parent inode number and the
 * inode number of the given vnode in preparation for calling gfs_readdir_init.
 */
used to obtain a parent inode number and the
inode number of the given vnode in preparation for calling gfs_readdir_init.
used to obtain a parent inode number and the inode number of the given vnode in preparation for calling gfs_readdir_init .
int
gfs_get_parent_ino(vnode_t *dvp, cred_t *cr, caller_context_t *ct,
    ino64_t *pino, ino64_t *ino)
{
	vnode_t *parent;
	gfs_dir_t *dp = dvp->v_data;
	int error;
	*ino = dp->gfsd_file.gfs_ino;
	parent = dp->gfsd_file.gfs_parent;
	if (parent == NULL) {
		*pino = *ino;		
	} else if (dvp->v_flag & V_XATTRDIR) {
#ifdef TODO
		vattr_t va;
		va.va_mask = AT_NODEID;
		error = VOP_GETATTR(parent, &va, 0, cr, ct);
		if (error)
			return (error);
		*pino = va.va_nodeid;
#else
		panic("%s:%u: not implemented", __func__, __LINE__);
#endif
	} else {
		*pino = ((gfs_file_t *)(parent->v_data))->gfs_ino;
	}
	return (0);
}
int gfs_get_parent_ino ( vnode_t * dvp , cred_t * cr , caller_context_t * ct , ino64_t * pino , ino64_t * ino ) { vnode_t * parent ; gfs_dir_t * dp = dvp -> v_data ; int error ; * ino = dp -> gfsd_file . gfs_ino ; parent = dp -> gfsd_file . gfs_parent ; if ( parent == NULL ) { * pino = * ino ; } else if ( dvp -> v_flag & V_XATTRDIR ) { #ifdef TODO vattr_t va ; va . va_mask = AT_NODEID ; error = VOP_GETATTR ( parent , & va , 0 , cr , ct ) ; if ( error ) return ( error ) ; * pino = va . va_nodeid ; #else panic ( " " , __func__ , __LINE__ ) ; #endif } else { * pino = ( ( gfs_file_t * ) ( parent -> v_data ) ) -> gfs_ino ; } return ( 0 ) ; }
gfs_get_parent_ino: used to obtain a parent inode number and the
 inode number of the given vnode in preparation for calling gfs_readdir_init.
gfs_get_parent_ino : used to obtain a parent inode number and the inode number of the given vnode in preparation for calling gfs_readdir_init .
/* root of filesystem */