FreeBSD/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
/*
 * gfs_dir_lookup_dynamic()
 *
 * This routine looks up the provided name amongst the dynamic entries
 * in the gfs directory and returns the corresponding vnode, if found.
 *
 * The gfs directory is expected to be locked by the caller prior to
 * calling this function.  The directory will be unlocked during the
 * execution of this function, but will be locked upon return from the
 * function.  This function returns 0 on success, non-zero on error.
 *
 * The dynamic lookups are performed by invoking the lookup
 * callback, which is passed to this function as the first argument.
 * The arguments to the callback are:
 *
 * int gfs_lookup_cb(vnode_t *pvp, const char *nm, vnode_t **vpp, cred_t *cr,
 *     int flags, int *deflgs, pathname_t *rpnp);
 *
 *	pvp	- parent vnode
 *	nm	- name of entry
 *	vpp	- pointer to resulting vnode
 *	cr	- pointer to cred
 *	flags	- flags value from lookup request
 *		ignored here; currently only used to request
 *		insensitive lookups
 *	direntflgs - output parameter, directory entry flags
 *		ignored here; currently only used to indicate a lookup
 *		has more than one possible match when case is not considered
 *	realpnp	- output parameter, real pathname
 *		ignored here; when lookup was performed case-insensitively,
 *		this field contains the "real" name of the file.
 *
 * 	Returns 0 on success, non-zero on error.
 */
gfs_dir_lookup_dynamic()
This routine looks up the provided name amongst the dynamic entries
in the gfs directory and returns the corresponding vnode, if found.

The gfs directory is expected to be locked by the caller prior to
calling this function.  The directory will be unlocked during the
execution of this function, but will be locked upon return from the
function.  This function returns 0 on success, non-zero on error.

The dynamic lookups are performed by invoking the lookup
callback, which is passed to this function as the first argument.
The arguments to the callback are.





Returns 0 on success, non-zero on error.
gfs_dir_lookup_dynamic () This routine looks up the provided name amongst the dynamic entries in the gfs directory and returns the corresponding vnode if found . The gfs directory is expected to be locked by the caller prior to calling this function . The directory will be unlocked during the execution of this function but will be locked upon return from the function . This function returns 0 on success non - zero on error . The dynamic lookups are performed by invoking the lookup callback which is passed to this function as the first argument . The arguments to the callback are . Returns 0 on success non - zero on error .
static int
gfs_dir_lookup_dynamic(gfs_lookup_cb callback, gfs_dir_t *dp,
    const char *nm, vnode_t *dvp, vnode_t **vpp, cred_t *cr, int flags,
    int *direntflags, pathname_t *realpnp)
{
	gfs_file_t *fp;
	ino64_t ino;
	int ret;
	ASSERT(GFS_DIR_LOCKED(dp));
	gfs_dir_unlock(dp);
	ret = callback(dvp, nm, vpp, &ino, cr, flags, direntflags, realpnp);
	gfs_dir_lock(dp);
	if (ret == 0 && !IS_XATTRDIR(dvp)) {
		fp = (gfs_file_t *)((*vpp)->v_data);
		fp->gfs_index = -1;
		fp->gfs_ino = ino;
	}
	return (ret);
}
static int gfs_dir_lookup_dynamic ( gfs_lookup_cb callback , gfs_dir_t * dp , const char * nm , vnode_t * dvp , vnode_t * * vpp , cred_t * cr , int flags , int * direntflags , pathname_t * realpnp ) { gfs_file_t * fp ; ino64_t ino ; int ret ; ASSERT ( GFS_DIR_LOCKED ( dp ) ) ; gfs_dir_unlock ( dp ) ; ret = callback ( dvp , nm , vpp , & ino , cr , flags , direntflags , realpnp ) ; gfs_dir_lock ( dp ) ; if ( ret == 0 && ! IS_XATTRDIR ( dvp ) ) { fp = ( gfs_file_t * ) ( ( * vpp ) -> v_data ) ; fp -> gfs_index = -1 ; fp -> gfs_ino = ino ; } return ( ret ) ; }
gfs_dir_lookup_dynamic()
 This routine looks up the provided name amongst the dynamic entries
 in the gfs directory and returns the corresponding vnode, if found.
gfs_dir_lookup_dynamic () This routine looks up the provided name amongst the dynamic entries in the gfs directory and returns the corresponding vnode if found .
/*
	 * Drop the directory lock, as the lookup routine
	 * will need to allocate memory, or otherwise deadlock on this
	 * directory.
	 */ /*
	 * The callback for extended attributes returns a vnode
	 * with v_data from an underlying fs.
	 */