Lines Matching refs:nsp

2184 	struct nlm_shres *nsp, *nsp_new;  in nlm_shres_track()  local
2194 for (nsp = hostp->nh_shrlist; nsp != NULL; nsp = nsp->ns_next) in nlm_shres_track()
2195 if (nsp->ns_vp == vp && nlm_shres_equal(shrp, nsp->ns_shr)) in nlm_shres_track()
2198 if (nsp != NULL) { in nlm_shres_track()
2206 nsp = nsp_new; in nlm_shres_track()
2208 nsp->ns_next = hostp->nh_shrlist; in nlm_shres_track()
2209 hostp->nh_shrlist = nsp; in nlm_shres_track()
2220 struct nlm_shres *nsp, *nsp_prev = NULL; in nlm_shres_untrack() local
2223 nsp = hostp->nh_shrlist; in nlm_shres_untrack()
2224 while (nsp != NULL) { in nlm_shres_untrack()
2225 if (nsp->ns_vp == vp && nlm_shres_equal(shrp, nsp->ns_shr)) { in nlm_shres_untrack()
2228 nsp_del = nsp; in nlm_shres_untrack()
2229 nsp = nsp->ns_next; in nlm_shres_untrack()
2231 nsp_prev->ns_next = nsp; in nlm_shres_untrack()
2233 hostp->nh_shrlist = nsp; in nlm_shres_untrack()
2239 nsp_prev = nsp; in nlm_shres_untrack()
2240 nsp = nsp->ns_next; in nlm_shres_untrack()
2255 struct nlm_shres *nsp, *nslist = NULL; in nlm_get_active_shres() local
2258 for (nsp = hostp->nh_shrlist; nsp != NULL; nsp = nsp->ns_next) { in nlm_get_active_shres()
2261 nsp_new = nlm_shres_create_item(nsp->ns_shr, nsp->ns_vp); in nlm_get_active_shres()
2277 struct nlm_shres *nsp; in nlm_free_shrlist() local
2280 nsp = nslist; in nlm_free_shrlist()
2283 nlm_shres_destroy_item(nsp); in nlm_free_shrlist()
2303 struct nlm_shres *nsp; in nlm_shres_create_item() local
2305 nsp = kmem_alloc(sizeof (*nsp), KM_SLEEP); in nlm_shres_create_item()
2306 nsp->ns_shr = kmem_alloc(sizeof (*shrp), KM_SLEEP); in nlm_shres_create_item()
2307 bcopy(shrp, nsp->ns_shr, sizeof (*shrp)); in nlm_shres_create_item()
2308 nsp->ns_shr->s_owner = kmem_alloc(shrp->s_own_len, KM_SLEEP); in nlm_shres_create_item()
2309 bcopy(shrp->s_owner, nsp->ns_shr->s_owner, shrp->s_own_len); in nlm_shres_create_item()
2310 nsp->ns_vp = vp; in nlm_shres_create_item()
2312 return (nsp); in nlm_shres_create_item()
2316 nlm_shres_destroy_item(struct nlm_shres *nsp) in nlm_shres_destroy_item() argument
2318 kmem_free(nsp->ns_shr->s_owner, in nlm_shres_destroy_item()
2319 nsp->ns_shr->s_own_len); in nlm_shres_destroy_item()
2320 kmem_free(nsp->ns_shr, sizeof (struct shrlock)); in nlm_shres_destroy_item()
2321 kmem_free(nsp, sizeof (*nsp)); in nlm_shres_destroy_item()