• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/timemachine/netatalk-2.2.0/etc/afpd/

Lines Matching defs:dir

53  * we have to calculate the location of eg directory with CNID 30, which is located in a dir with
56 * the element "fullpath" in struct dir, which is used to avoid the recursion in any case. Wheneveer
57 * a struct dir is initialized, the fullpath to the directory is stored there.
61 * the flag DIRF_ISFILE in struct dir.d_flags for files.
66 * (2) if it wasn't found a new struct dir is created and cached both from within dir_add()
72 * (7) then a struct dir is initialized via dir_new() (note the fullpath arg is NULL)
82 * struct dir.ctime_dircache. Later when we search the cache we compare the stored
91 * the dir itself (name, CNID, ...) hasn't changed, but there's no other way.
98 * It is a hashtable which we use to store "struct dir"s in. If the cache get full, oldest
134 const struct dir *k = (const struct dir *)key;
156 const struct dir *k1 = key1;
157 const struct dir *k2 = key2;
180 const struct dir *key = (const struct dir *)p;
227 const struct dir *key1 = (const struct dir *)k1;
228 const struct dir *key2 = (const struct dir *)k2;
248 * 3. Remove the dir from the main cache and the didname index
249 * 4. Free the struct dir structure and all its members
254 struct dir *dir;
259 if ((dir = (struct dir *)dequeue(index_queue)) == NULL) { /* 1 */
265 if (curdir == dir) { /* 2 */
266 if ((dir->qidx_node = enqueue(index_queue, dir)) == NULL) {
274 dircache_remove(NULL, dir, DIRCACHE | DIDNAME_INDEX); /* 3 */
275 dir_free(dir); /* 4 */
304 * @returns Pointer to struct dir if found, else NULL
306 struct dir *dircache_search_by_did(const struct vol *vol, cnid_t cnid)
308 struct dir *cdir = NULL;
309 struct dir key;
363 * @param dir (r) directory
367 * @returns pointer to struct dir if found in cache, else NULL
369 struct dir *dircache_search_by_name(const struct vol *vol,
370 const struct dir *dir,
374 struct dir *cdir = NULL;
375 struct dir key;
382 AFP_ASSERT(dir);
389 ntohl(dir->d_did), name);
391 if (dir->d_did != DIRDID_ROOT_PARENT) {
393 key.d_pdid = dir->d_did;
403 ntohl(dir->d_did), name, cfrombstr(cdir->d_fullpath));
412 ntohl(dir->d_did), name);
418 ntohl(dir->d_did), name);
422 ntohl(dir->d_did), name);
430 * @brief create struct dir from struct path
432 * Add a struct dir to the cache and its indexes.
434 * @param dir (r) pointer to parrent directory
439 struct dir *dir)
441 struct dir *cdir = NULL;
442 struct dir key;
445 AFP_ASSERT(dir);
446 AFP_ASSERT(ntohl(dir->d_pdid) >= 2);
447 AFP_ASSERT(ntohl(dir->d_did) >= CNID_START);
448 AFP_ASSERT(dir->d_u_name);
449 AFP_ASSERT(dir->d_vid);
461 key.d_vid = dir->d_vid;
462 key.d_did = dir->d_did;
469 key.d_pdid = dir->d_did;
470 key.d_u_name = dir->d_u_name;
478 if (hash_alloc_insert(dircache, dir, dir) == 0) {
484 if (hash_alloc_insert(index_didname, dir, dir) == 0) {
490 if ((dir->qidx_node = enqueue(index_queue, dir)) == NULL) {
499 ntohl(dir->d_did), cfrombstr(dir->d_u_name));
506 if (!strcmp("bands", cfrombstr(dir->d_u_name)))
508 afp_recbandsdid(ntohl(dir->d_did));
511 __func__,ntohl(dir->d_did)); */
514 if (strstr(cfrombstr(dir->d_u_name),"sparsebundle" ))
517 afp_recSparsedid(ntohl(dir->d_did));
520 __func__,ntohl(dir->d_did)); */
538 void dircache_remove(const struct vol *vol _U_, struct dir *dir, int flags)
542 AFP_ASSERT(dir);
547 dequeue(dir->qidx_node->prev); /* this effectively deletes the dequeued node */
552 if ((hn = hash_lookup(index_didname, dir)) == NULL) {
554 ntohl(dir->d_did), cfrombstr(dir->d_u_name));
562 if ((hn = hash_lookup(dircache, dir)) == NULL) {
564 ntohl(dir->d_did), cfrombstr(dir->d_u_name));
572 ntohl(dir->d_did), cfrombstr(dir->d_u_name));
657 const struct dir *dir;
678 dir = hnode_get(hn);
681 ntohs(dir->d_vid),
682 ntohl(dir->d_pdid),
683 ntohl(dir->d_did),
684 dir->d_flags & DIRF_ISFILE ? "f" : "d",
685 cfrombstr(dir->d_fullpath));
694 dir = hnode_get(hn);
697 ntohs(dir->d_vid),
698 ntohl(dir->d_pdid),
699 ntohl(dir->d_did),
700 dir->d_flags & DIRF_ISFILE ? "f" : "d",
701 cfrombstr(dir->d_fullpath));
711 dir = (struct dir *)n->data;
714 ntohs(dir->d_vid),
715 ntohl(dir->d_pdid),
716 ntohl(dir->d_did),
717 dir->d_flags & DIRF_ISFILE ? "f" : "d",
718 cfrombstr(dir->d_fullpath));