FreeBSD/sys/netsmb/smb_conn.c
/*
 * Lookup share in the given VC. Share referenced and locked on return.
 * VC expected to be locked on entry and will be left locked on exit.
 */
Lookup share in the given VC. Share referenced and locked on return.
VC expected to be locked on entry and will be left locked on exit.
Lookup share in the given VC . Share referenced and locked on return . VC expected to be locked on entry and will be left locked on exit .
int
smb_vc_lookupshare(struct smb_vc *vcp, struct smb_sharespec *dp,
	struct smb_cred *scred,	struct smb_share **sspp)
{
	struct smb_connobj *scp = NULL;
	struct smb_share *ssp = NULL;
	int error;
	*sspp = NULL;
	dp->scred = scred;
	SMBCO_FOREACH(scp, VCTOCP(vcp)) {
		ssp = (struct smb_share *)scp;
		error = smb_share_lock(ssp);
		if (error)
			continue;
		if (smb_vc_cmpshare(ssp, dp) == 0)
			break;
		smb_share_unlock(ssp);
	}
	if (ssp) {
		smb_share_ref(ssp);
		*sspp = ssp;
		error = 0;
	} else
		error = ENOENT;
	return error;
}
int smb_vc_lookupshare ( struct smb_vc * vcp , struct smb_sharespec * dp , struct smb_cred * scred , struct smb_share * * sspp ) { struct smb_connobj * scp = NULL ; struct smb_share * ssp = NULL ; int error ; * sspp = NULL ; dp -> scred = scred ; SMBCO_FOREACH ( scp , VCTOCP ( vcp ) ) { ssp = ( struct smb_share * ) scp ; error = smb_share_lock ( ssp ) ; if ( error ) continue ; if ( smb_vc_cmpshare ( ssp , dp ) == 0 ) break ; smb_share_unlock ( ssp ) ; } if ( ssp ) { smb_share_ref ( ssp ) ; * sspp = ssp ; error = 0 ; } else error = ENOENT ; return error ; }
Lookup share in the given VC.
Lookup share in the given VC .