Lines Matching refs:bucket
367 realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n]; in realpath_cache_del() local
369 while (*bucket != NULL) { in realpath_cache_del()
370 if (key == (*bucket)->key && path_len == (*bucket)->path_len && in realpath_cache_del()
371 memcmp(path, (*bucket)->path, path_len) == 0) { in realpath_cache_del()
372 realpath_cache_bucket *r = *bucket; in realpath_cache_del()
373 *bucket = (*bucket)->next; in realpath_cache_del()
385 bucket = &(*bucket)->next; in realpath_cache_del()
403 realpath_cache_bucket *bucket = malloc(size); in realpath_cache_add() local
406 if (bucket == NULL) { in realpath_cache_add()
410 bucket->key = realpath_cache_key(path, path_len); in realpath_cache_add()
411 bucket->path = (char*)bucket + sizeof(realpath_cache_bucket); in realpath_cache_add()
412 memcpy(bucket->path, path, path_len+1); in realpath_cache_add()
413 bucket->path_len = path_len; in realpath_cache_add()
415 bucket->realpath = bucket->path; in realpath_cache_add()
417 bucket->realpath = bucket->path + (path_len + 1); in realpath_cache_add()
418 memcpy(bucket->realpath, realpath, realpath_len+1); in realpath_cache_add()
420 bucket->realpath_len = realpath_len; in realpath_cache_add()
421 bucket->is_dir = is_dir > 0; in realpath_cache_add()
423 bucket->is_rvalid = 0; in realpath_cache_add()
424 bucket->is_readable = 0; in realpath_cache_add()
425 bucket->is_wvalid = 0; in realpath_cache_add()
426 bucket->is_writable = 0; in realpath_cache_add()
428 bucket->expires = t + CWDG(realpath_cache_ttl); in realpath_cache_add()
429 n = bucket->key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0])); in realpath_cache_add()
430 bucket->next = CWDG(realpath_cache)[n]; in realpath_cache_add()
431 CWDG(realpath_cache)[n] = bucket; in realpath_cache_add()
441 realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n]; in realpath_cache_find() local
443 while (*bucket != NULL) { in realpath_cache_find()
444 if (CWDG(realpath_cache_ttl) && (*bucket)->expires < t) { in realpath_cache_find()
445 realpath_cache_bucket *r = *bucket; in realpath_cache_find()
446 *bucket = (*bucket)->next; in realpath_cache_find()
455 } else if (key == (*bucket)->key && path_len == (*bucket)->path_len && in realpath_cache_find()
456 memcmp(path, (*bucket)->path, path_len) == 0) { in realpath_cache_find()
457 return *bucket; in realpath_cache_find()
459 bucket = &(*bucket)->next; in realpath_cache_find()
507 realpath_cache_bucket *bucket; in tsrm_realpath_r() local
584 if ((bucket = realpath_cache_find(path, len, *t)) != NULL) { in tsrm_realpath_r()
585 if (is_dir && !bucket->is_dir) { in tsrm_realpath_r()
590 *link_is_dir = bucket->is_dir; in tsrm_realpath_r()
592 memcpy(path, bucket->realpath, bucket->realpath_len + 1); in tsrm_realpath_r()
593 return bucket->realpath_len; in tsrm_realpath_r()