Lines Matching defs:cncp
119 coda_nc_remove(struct coda_cache *cncp, enum dc_status dcstat);
173 struct coda_cache *cncp;
180 LIST_FOREACH(cncp, &coda_nc_hash[hash].head, hash)
183 if ((CODA_NAMEMATCH(cncp, name, namelen, dcp)) &&
184 ((cred == 0) || (cncp->cred == cred)))
188 return(cncp);
191 else if (CODA_NAMEMATCH(cncp, name, namelen, dcp)) {
193 name, cred, cncp->cred);
198 kauth_cred_getrefcnt(cncp->cred),
199 kauth_cred_geteuid(cncp->cred),
200 kauth_cred_getegid(cncp->cred));
202 coda_print_cred(cncp->cred);
219 struct coda_cache *cncp;
237 cncp = coda_nc_find(dcp, name, namelen, cred, hash);
238 if (cncp != (struct coda_cache *) 0) {
246 cncp = TAILQ_FIRST(&coda_nc_lru.head);
247 TAILQ_REMOVE(&coda_nc_lru.head, cncp, lru);
249 if (CODA_NC_VALID(cncp)) {
253 coda_nc_hash[CODA_NC_HASH(cncp->name, cncp->namelen, cncp->dcp)].length--;
256 LIST_REMOVE(cncp, hash);
257 vrele(CTOV(cncp->dcp));
258 vrele(CTOV(cncp->cp));
259 kauth_cred_free(cncp->cred);
268 cncp->dcp = dcp;
269 cncp->cp = cp;
270 cncp->namelen = namelen;
271 cncp->cred = cred;
273 memcpy(cncp->name, name, (unsigned)namelen);
276 TAILQ_INSERT_TAIL(&coda_nc_lru.head, cncp, lru);
277 LIST_INSERT_HEAD(&coda_nc_hash[hash].head, cncp, hash);
292 struct coda_cache *cncp;
310 cncp = coda_nc_find(dcp, name, namelen, cred, hash);
311 if (cncp == (struct coda_cache *) 0) {
319 TAILQ_REMOVE(&coda_nc_lru.head, cncp, lru);
320 TAILQ_INSERT_TAIL(&coda_nc_lru.head, cncp, lru);
324 LIST_REMOVE(cncp, hash);
325 LIST_INSERT_HEAD(&coda_nc_hash[hash].head, cncp, hash);
329 dcp, name, cred, cncp->cp); )
331 return(cncp->cp);
335 coda_nc_remove(struct coda_cache *cncp, enum dc_status dcstat)
338 * remove an entry -- vrele(cncp->dcp, cp), crfree(cred),
344 cncp->name, coda_f2s(&cncp->dcp->c_fid))); )
347 LIST_REMOVE(cncp, hash);
348 memset(&cncp->hash, 0, sizeof(cncp->hash));
350 if ((dcstat == IS_DOWNCALL) && (vrefcnt(CTOV(cncp->dcp)) == 1)) {
351 cncp->dcp->c_flags |= C_PURGING;
353 vrele(CTOV(cncp->dcp));
355 if ((dcstat == IS_DOWNCALL) && (vrefcnt(CTOV(cncp->cp)) == 1)) {
356 cncp->cp->c_flags |= C_PURGING;
358 vrele(CTOV(cncp->cp));
360 kauth_cred_free(cncp->cred);
361 memset(DATA_PART(cncp), 0, DATA_SIZE);
364 TAILQ_REMOVE(&coda_nc_lru.head, cncp, lru);
365 TAILQ_INSERT_HEAD(&coda_nc_lru.head, cncp, lru);
379 struct coda_cache *cncp, *ncncp;
398 while ((cncp = ncncp) != NULL) {
399 ncncp = LIST_NEXT(cncp, hash);
401 if (coda_fid_eq(&(cncp->dcp->c_fid), fid)) {
403 coda_nc_remove(cncp, dcstat);
418 struct coda_cache *cncp, *ncncp;
432 while ((cncp = ncncp) != NULL) {
433 ncncp = LIST_NEXT(cncp, hash);
435 if (coda_fid_eq(&cncp->cp->c_fid, fid)) {
437 coda_nc_remove(cncp, dcstat);
471 struct coda_cache *cncp;
489 cncp = coda_nc_find(dcp, name, namelen, 0, hash);
491 while (cncp) {
494 coda_nc_remove(cncp, NOT_DOWNCALL);
495 cncp = coda_nc_find(dcp, name, namelen, 0, hash);
514 struct coda_cache *cncp, *ncncp;
525 while ((cncp = ncncp) != NULL) {
526 ncncp = TAILQ_NEXT(cncp, lru);
528 if ((CODA_NC_VALID(cncp)) &&
529 (kauth_cred_geteuid(cncp->cred) == uid)) {
533 hash = CODA_NC_HASH(cncp->name, cncp->namelen, cncp->dcp);
536 coda_nc_remove(cncp, dcstat);
558 struct coda_cache *cncp;
566 TAILQ_FOREACH(cncp, &coda_nc_lru.head, lru) {
567 if (CODA_NC_VALID(cncp)) { /* only zero valid nodes */
568 LIST_REMOVE(cncp, hash);
569 memset(&cncp->hash, 0, sizeof(cncp->hash));
572 && (vrefcnt(CTOV(cncp->dcp)) == 1))
574 cncp->dcp->c_flags |= C_PURGING;
576 vrele(CTOV(cncp->dcp));
578 if (CTOV(cncp->cp)->v_iflag & VI_TEXT) {
579 if (coda_vmflush(cncp->cp))
582 coda_f2s(&cncp->cp->c_fid))); )
586 && (vrefcnt(CTOV(cncp->cp)) == 1))
588 cncp->cp->c_flags |= C_PURGING;
590 vrele(CTOV(cncp->cp));
592 kauth_cred_free(cncp->cred);
593 memset(DATA_PART(cncp), 0, DATA_SIZE);
612 struct coda_cache *cncp;
617 LIST_FOREACH(cncp, &coda_nc_hash[hash].head, hash) {
619 cncp->cp, cncp->dcp,
620 cncp->cred, cncp->name));
699 struct coda_cache *cncp;
707 LIST_FOREACH(cncp, &coda_nc_hash[i].head, hash) {
708 if (cncp->cp == cp) {
709 memcpy(coda_nc_name_buf, cncp->name, cncp->namelen);
710 coda_nc_name_buf[cncp->namelen] = 0;
712 coda_nc_name_buf, cncp->cp, cncp->dcp, cncp);