FreeBSD/sys/fs/nfsclient/nfs_clstate.c
/*
 * Search for a lock conflict locally on the client. A conflict occurs if
 * - not same owner and overlapping byte range and at least one of them is
 *   a write lock or this is an unlock.
 */
Search for a lock conflict locally on the client. A conflict occurs if
- not same owner and overlapping byte range and at least one of them is
a write lock or this is an unlock.
Search for a lock conflict locally on the client . A conflict occurs if - not same owner and overlapping byte range and at least one of them is a write lock or this is an unlock .
static int
nfscl_localconflict(struct nfsclclient *clp, u_int8_t *fhp, int fhlen,
    struct nfscllock *nlop, u_int8_t *own, struct nfscldeleg *dp,
    struct nfscllock **lopp)
{
	struct nfsclowner *owp;
	struct nfsclopen *op;
	int ret;
	if (dp != NULL) {
		ret = nfscl_checkconflict(&dp->nfsdl_lock, nlop, own, lopp);
		if (ret)
			return (ret);
	}
	LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) {
		LIST_FOREACH(op, &owp->nfsow_open, nfso_list) {
			if (op->nfso_fhlen == fhlen &&
			    !NFSBCMP(op->nfso_fh, fhp, fhlen)) {
				ret = nfscl_checkconflict(&op->nfso_lock, nlop,
				    own, lopp);
				if (ret)
					return (ret);
			}
		}
	}
	return (0);
}
static int nfscl_localconflict ( struct nfsclclient * clp , u_int8_t * fhp , int fhlen , struct nfscllock * nlop , u_int8_t * own , struct nfscldeleg * dp , struct nfscllock * * lopp ) { struct nfsclowner * owp ; struct nfsclopen * op ; int ret ; if ( dp != NULL ) { ret = nfscl_checkconflict ( & dp -> nfsdl_lock , nlop , own , lopp ) ; if ( ret ) return ( ret ) ; } LIST_FOREACH ( owp , & clp -> nfsc_owner , nfsow_list ) { LIST_FOREACH ( op , & owp -> nfsow_open , nfso_list ) { if ( op -> nfso_fhlen == fhlen && ! NFSBCMP ( op -> nfso_fh , fhp , fhlen ) ) { ret = nfscl_checkconflict ( & op -> nfso_lock , nlop , own , lopp ) ; if ( ret ) return ( ret ) ; } } } return ( 0 ) ; }
Search for a lock conflict locally on the client.
Search for a lock conflict locally on the client .