Lines Matching refs:current

64 			struct CACHED_GENERIC *current)
71 h = cache->dohash(current);
82 link->entry = current;
104 const struct CACHED_GENERIC *current, int hash)
114 while (link && (link->entry != current)) {
150 struct CACHED_GENERIC *current;
155 current = (struct CACHED_GENERIC*)NULL;
167 current = link->entry;
174 current = cache->most_recent_entry;
175 while (current
176 && compare(current, wanted)) {
177 current = current->next;
180 if (current) {
181 previous = current->previous;
185 * found and not at head of list, unlink from current
188 previous->next = current->next;
189 if (current->next)
190 current->next->previous
191 = current->previous;
194 = current->previous;
195 current->next = cache->most_recent_entry;
196 current->previous
198 cache->most_recent_entry->previous = current;
199 cache->most_recent_entry = current;
204 return (current);
216 struct CACHED_GENERIC *current;
221 current = (struct CACHED_GENERIC*)NULL;
233 current = link->entry;
243 current = cache->most_recent_entry;
244 while (current
245 && compare(current, item)) {
246 current = current->next;
250 if (!current) {
260 current = cache->free_entry;
263 current->variable = ntfs_malloc(
266 current->variable = (void*)NULL;
267 current->varsize = item->varsize;
269 cache->oldest_entry = current;
272 current = cache->oldest_entry;
273 before = current->previous;
276 drophashindex(cache,current,
277 cache->dohash(current));
279 cache->dofree(current);
280 cache->oldest_entry = current->previous;
282 if (current->varsize)
283 current->variable = realloc(
284 current->variable,
287 current->variable = ntfs_malloc(
290 if (current->varsize)
291 free(current->variable);
292 current->variable = (void*)NULL;
294 current->varsize = item->varsize;
296 current->next = cache->most_recent_entry;
297 current->previous = (struct CACHED_GENERIC*)NULL;
299 cache->most_recent_entry->previous = current;
300 cache->most_recent_entry = current;
301 memcpy(current->payload, item->payload, cache->fixed_size);
303 if (current->variable) {
304 memcpy(current->variable,
312 cache->most_recent_entry = current->next;
313 current->next = cache->free_entry;
314 cache->free_entry = current;
315 current = (struct CACHED_GENERIC*)NULL;
318 current->variable = (void*)NULL;
319 current->varsize = 0;
321 if (cache->dohash && current)
322 inserthashindex(cache,current);
326 return (current);
336 struct CACHED_GENERIC *current, int flags)
340 previous = current->previous;
342 cache->dofree(current);
346 if (current->next)
347 current->next->previous = current->previous;
349 cache->oldest_entry = current->previous;
351 previous->next = current->next;
353 cache->most_recent_entry = current->next;
354 current->next = cache->free_entry;
355 cache->free_entry = current;
356 if (current->variable)
357 free(current->variable);
358 current->varsize = 0;
378 struct CACHED_GENERIC *current;
384 current = (struct CACHED_GENERIC*)NULL;
398 current = link->entry;
400 if (current) {
401 drophashindex(cache,current,h);
403 current,flags);
413 current = cache->most_recent_entry;
414 while (current) {
415 if (!compare(current, item)) {
416 next = current->next;
418 drophashindex(cache,current,
419 cache->dohash(current));
420 do_invalidate(cache,current,flags);
421 current = next;
424 current = current->next;