FreeBSD/sys/fs/nfsclient/nfs_clstate.c
/*
 * Get the mount point related to a given cbident or session and busy it.
 */
Get the mount point related to a given cbident or session and busy it.
Get the mount point related to a given cbident or session and busy it .
static mount_t
nfscl_getmnt(int minorvers, uint8_t *sessionid, u_int32_t cbident,
    struct nfsclclient **clpp)
{
	struct nfsclclient *clp;
	mount_t mp;
	int error;
	*clpp = NULL;
	NFSLOCKCLSTATE();
	LIST_FOREACH(clp, &nfsclhead, nfsc_list) {
		if (minorvers == NFSV4_MINORVERSION) {
			if (clp->nfsc_cbident == cbident)
				break;
		} else if (!NFSBCMP(NFSMNT_MDSSESSION(clp->nfsc_nmp)->
		    nfsess_sessionid, sessionid, NFSX_V4SESSIONID))
			break;
	}
	if (clp == NULL) {
		NFSUNLOCKCLSTATE();
		return (NULL);
	}
	mp = clp->nfsc_nmp->nm_mountp;
	vfs_ref(mp);
	NFSUNLOCKCLSTATE();
	error = vfs_busy(mp, 0);
	vfs_rel(mp);
	if (error != 0)
		return (NULL);
	*clpp = clp;
	return (mp);
}
static mount_t nfscl_getmnt ( int minorvers , uint8_t * sessionid , u_int32_t cbident , struct nfsclclient * * clpp ) { struct nfsclclient * clp ; mount_t mp ; int error ; * clpp = NULL ; NFSLOCKCLSTATE ( ) ; LIST_FOREACH ( clp , & nfsclhead , nfsc_list ) { if ( minorvers == NFSV4_MINORVERSION ) { if ( clp -> nfsc_cbident == cbident ) break ; } else if ( ! NFSBCMP ( NFSMNT_MDSSESSION ( clp -> nfsc_nmp ) -> nfsess_sessionid , sessionid , NFSX_V4SESSIONID ) ) break ; } if ( clp == NULL ) { NFSUNLOCKCLSTATE ( ) ; return ( NULL ) ; } mp = clp -> nfsc_nmp -> nm_mountp ; vfs_ref ( mp ) ; NFSUNLOCKCLSTATE ( ) ; error = vfs_busy ( mp , 0 ) ; vfs_rel ( mp ) ; if ( error != 0 ) return ( NULL ) ; * clpp = clp ; return ( mp ) ; }
Get the mount point related to a given cbident or session and busy it.
Get the mount point related to a given cbident or session and busy it .