Lines Matching defs:ncp

233 #define	nc_inshash(ncp, hp) \
235 (ncp)->hash_next = (hp)->hash_next; \
236 (ncp)->hash_prev = (ncache_t *)(hp); \
237 (hp)->hash_next->hash_prev = (ncp); \
238 (hp)->hash_next = (ncp); \
244 #define nc_rmhash(ncp) \
246 (ncp)->hash_prev->hash_next = (ncp)->hash_next; \
247 (ncp)->hash_next->hash_prev = (ncp)->hash_prev; \
248 (ncp)->hash_prev = NULL; \
249 (ncp)->hash_next = NULL; \
255 #define dnlc_free(ncp) \
257 kmem_free((ncp), sizeof (ncache_t) + (ncp)->namlen); \
438 ncache_t *ncp;
456 if ((ncp = dnlc_get(namlen)) == NULL)
458 ncp->dp = dp;
460 ncp->vp = vp;
462 bcopy(name, ncp->name, namlen + 1); /* name and null */
463 ncp->hash = hash;
473 dnlc_free(ncp); /* crfree done here */
481 nc_inshash(ncp, hp);
504 ncache_t *ncp;
528 if ((ncp = dnlc_get(namlen)) == NULL) {
532 ncp->dp = dp;
534 ncp->vp = vp;
536 bcopy(name, ncp->name, namlen + 1); /* name and null */
537 ncp->hash = hash;
561 dnlc_free(ncp); /* crfree done here */
567 nc_inshash(ncp, hp);
586 ncache_t *ncp;
607 for (ncp = hp->hash_next; ncp != (ncache_t *)hp;
608 ncp = ncp->hash_next) {
609 if (ncp->hash == hash && /* fast signature check */
610 ncp->dp == dp &&
611 ncp->namlen == namlen &&
612 bcmp(ncp->name, name, namlen) == 0) {
618 ncache_t *next = ncp->hash_next;
619 ncache_t *prev = ncp->hash_prev;
623 ncp->hash_next = next = hp->hash_next;
624 ncp->hash_prev = (ncache_t *)hp;
625 next->hash_prev = ncp;
626 hp->hash_next = ncp;
636 vp = ncp->vp;
667 ncache_t *ncp;
678 if (ncp = dnlc_search(dp, name, namlen, hash)) {
682 nc_rmhash(ncp);
684 VN_RELE_DNLC(ncp->vp);
685 VN_RELE_DNLC(ncp->dp);
686 dnlc_free(ncp);
699 ncache_t *ncp;
713 ncp = nch->hash_next;
714 while (ncp != (ncache_t *)nch) {
717 np = ncp->hash_next;
718 nc_rele[index++] = ncp->vp;
719 nc_rele[index++] = ncp->dp;
721 nc_rmhash(ncp);
722 dnlc_free(ncp);
723 ncp = np;
734 if (ncp != (ncache_t *)nch) {
748 ncache_t *ncp;
766 ncp = nch->hash_next;
767 while (ncp != (ncache_t *)nch) {
770 np = ncp->hash_next;
771 if (ncp->dp == vp || ncp->vp == vp) {
772 nc_rele[index++] = ncp->vp;
773 nc_rele[index++] = ncp->dp;
774 nc_rmhash(ncp);
775 dnlc_free(ncp);
778 ncp = np;
782 ncp = np;
795 if (ncp != (ncache_t *)nch) {
811 ncache_t *ncp;
826 ncp = nch->hash_next;
827 while (ncp != (ncache_t *)nch) {
830 np = ncp->hash_next;
831 ASSERT(ncp->dp != NULL);
832 ASSERT(ncp->vp != NULL);
833 if ((ncp->dp->v_vfsp == vfsp) ||
834 (ncp->vp->v_vfsp == vfsp)) {
836 nc_rele[index++] = ncp->vp;
837 nc_rele[index++] = ncp->dp;
838 nc_rmhash(ncp);
839 dnlc_free(ncp);
842 ncp = np;
849 ncp = np;
859 if (ncp != (ncache_t *)nch) {
882 ncache_t *ncp;
902 for (ncp = hp->hash_prev;
903 ncp != (ncache_t *)hp;
904 ncp = ncp->hash_prev) {
905 vp = ncp->vp;
910 if (ncp != (ncache_t *)hp) {
911 nc_rmhash(ncp);
913 VN_RELE_DNLC(ncp->dp);
915 dnlc_free(ncp);
932 ncache_t *ncp;
936 for (ncp = hp->hash_next; ncp != (ncache_t *)hp; ncp = ncp->hash_next) {
937 if (ncp->hash == hash &&
938 ncp->dp == dp &&
939 ncp->namlen == namlen &&
940 bcmp(ncp->name, name, namlen) == 0)
941 return (ncp);
973 ncache_t *ncp;
979 ncp = kmem_alloc(sizeof (ncache_t) + namlen, KM_NOSLEEP);
980 if (ncp == NULL) {
983 ncp->namlen = namlen;
986 return (ncp);
1001 ncache_t *ncp;
1043 for (cnt = 0, ncp = hp->hash_prev; ncp != (ncache_t *)hp;
1044 ncp = ncp->hash_prev, cnt++) {
1045 vp = ncp->vp;
1061 ncp = hp->hash_prev;
1063 vp = ncp->vp;
1073 ncp = hp->hash_prev; /* pick the last one in the hash queue */
1075 vp = ncp->vp;
1080 nc_rmhash(ncp);
1083 VN_RELE_DNLC(ncp->dp);
1084 dnlc_free(ncp);