Lines Matching refs:pc
44 #define TRACE_HIT_CACHE(pc) do { pc->hit++; g_totalPathCacheHit++; } while (0)
55 #define TRACE_HIT_CACHE(pc)
70 struct PathCache *pc = NULL;
73 LOS_DL_LIST_FOR_EACH_ENTRY(pc, nhead, struct PathCache, hashEntry) {
75 pc->name, pc->parentVnode, pc->childVnode, pc->nameLen);
114 struct PathCache *pc = NULL;
123 pc = (struct PathCache*)zalloc(pathCacheSize);
124 if (pc == NULL) {
129 ret = strncpy_s(pc->name, len + 1, name, len);
131 free(pc);
135 pc->parentVnode = parent;
136 pc->nameLen = len;
137 pc->childVnode = vnode;
139 LOS_ListAdd((&(parent->childPathCaches)), (&(pc->childEntry)));
140 LOS_ListAdd((&(vnode->parentPathCaches)), (&(pc->parentEntry)));
142 PathCacheInsert(parent, pc, name, len);
144 return pc;
147 int PathCacheFree(struct PathCache *pc)
149 if (pc == NULL) {
154 LOS_ListDelete(&pc->hashEntry);
155 LOS_ListDelete(&pc->parentEntry);
156 LOS_ListDelete(&pc->childEntry);
157 free(pc);
164 struct PathCache *pc = NULL;
169 LOS_DL_LIST_FOR_EACH_ENTRY(pc, dhead, struct PathCache, hashEntry) {
170 if (pc->parentVnode == parent && pc->nameLen == len && !strncmp(pc->name, name, len)) {
171 *vnode = pc->childVnode;
172 TRACE_HIT_CACHE(pc);