Lines Matching defs:dir

54 	} dir;
174 list_init(&vnode->stream.dir.cookies);
175 mutex_init(&vnode->stream.dir.cookie_lock, "rootfs dir cookies");
187 if (!force_delete && (v->stream.dir.dir_head != NULL || v->dir_next != NULL))
194 mutex_destroy(&v->stream.dir.cookie_lock);
205 update_dir_cookies(struct rootfs_vnode* dir, struct rootfs_vnode* vnode)
210 &dir->stream.dir.cookies, cookie)) != NULL) {
219 rootfs_find_in_dir(struct rootfs_vnode* dir, const char* path)
224 return dir;
226 return dir->parent;
228 for (vnode = dir->stream.dir.dir_head; vnode; vnode = vnode->dir_next) {
237 rootfs_insert_in_dir(struct rootfs* fs, struct rootfs_vnode* dir,
242 struct rootfs_vnode* node = dir->stream.dir.dir_head;
250 vnode->dir_next = dir->stream.dir.dir_head;
251 dir->stream.dir.dir_head = vnode;
258 vnode->parent = dir;
259 dir->modification_time = current_timespec();
261 notify_stat_changed(fs->id, dir->id, B_STAT_MODIFICATION_TIME);
267 rootfs_remove_from_dir(struct rootfs* fs, struct rootfs_vnode* dir,
273 for (vnode = dir->stream.dir.dir_head, lastVnode = NULL; vnode != NULL;
277 update_dir_cookies(dir, vnode);
282 dir->stream.dir.dir_head = vnode->dir_next;
285 dir->modification_time = current_timespec();
286 notify_stat_changed(fs->id, dir->id, B_STAT_MODIFICATION_TIME);
295 rootfs_is_dir_empty(struct rootfs_vnode* dir)
297 return !dir->stream.dir.dir_head;
327 rootfs_remove(struct rootfs* fs, struct rootfs_vnode* dir, const char* name,
335 vnode = rootfs_find_in_dir(dir, name);
348 entry_cache_remove(fs->volume->id, dir->id, name);
350 return remove_node(fs, dir, vnode);
455 struct rootfs_vnode* dir = (struct rootfs_vnode*)_dir->private_node;
458 TRACE(("rootfs_lookup: entry dir %p, name '%s'\n", dir, name));
459 if (!S_ISDIR(dir->stream.type))
465 vnode = rootfs_find_in_dir(dir, name);
473 entry_cache_add(fs->volume->id, dir->id, name, vnode->id);
550 // can't remove node if it's linked to the dir
552 "dir\n", vnode);
629 struct rootfs_vnode* dir = (rootfs_vnode*)_dir->private_node;
632 TRACE(("rootfs_create_dir: dir %p, name = '%s', perms = %d\n", dir, name,
637 vnode = rootfs_find_in_dir(dir, name);
642 vnode = rootfs_create_vnode(fs, dir, name, S_IFDIR | (mode & S_IUMSK));
646 rootfs_insert_in_dir(fs, dir, vnode);
649 entry_cache_add(fs->volume->id, dir->id, name, vnode->id);
650 notify_entry_created(fs->id, dir->id, name, vnode->id);
660 struct rootfs_vnode* dir = (rootfs_vnode*)_dir->private_node;
662 TRACE(("rootfs_remove_dir: dir %p (0x%Lx), name '%s'\n", dir, dir->id,
665 return rootfs_remove(fs, dir, name, true);
685 mutex_init(&cookie->lock, "rootfs dir cookie");
689 cookie->current = vnode->stream.dir.dir_head;
692 mutex_lock(&vnode->stream.dir.cookie_lock);
693 list_add_item(&vnode->stream.dir.cookies, cookie);
694 mutex_unlock(&vnode->stream.dir.cookie_lock);
711 mutex_lock(&vnode->stream.dir.cookie_lock);
712 list_remove_item(&vnode->stream.dir.cookies, cookie);
713 mutex_unlock(&vnode->stream.dir.cookie_lock);
747 nextChildNode = vnode->stream.dir.dir_head;
753 nextChildNode = vnode->stream.dir.dir_head;
800 cookie->current = vnode->stream.dir.dir_head;
863 struct rootfs_vnode* dir = (rootfs_vnode*)_dir->private_node;
866 TRACE(("rootfs_symlink: dir %p, name = '%s', path = %s\n", dir, name, path));
870 vnode = rootfs_find_in_dir(dir, name);
875 vnode = rootfs_create_vnode(fs, dir, name, S_IFLNK | (mode & S_IUMSK));
879 rootfs_insert_in_dir(fs, dir, vnode);
889 entry_cache_add(fs->volume->id, dir->id, name, vnode->id);
891 notify_entry_created(fs->id, dir->id, name, vnode->id);
901 struct rootfs_vnode* dir = (rootfs_vnode*)_dir->private_node;
903 TRACE(("rootfs_unlink: dir %p (0x%Lx), name '%s'\n", dir, dir->id, name));
905 return rootfs_remove(fs, dir, name, false);
972 // remove it from the dir
976 // Add it back to the dir with the new name.
1069 struct rootfs_vnode* dir = (rootfs_vnode*)_dir->private_node;
1075 vnode = rootfs_find_in_dir(dir, name);
1080 vnode = rootfs_create_vnode(fs, dir, name, mode);
1085 rootfs_insert_in_dir(fs, dir, vnode);
1102 rootfs_remove_from_dir(fs, dir, vnode);
1108 entry_cache_add(fs->volume->id, dir->id, name, vnode->id);
1109 notify_entry_created(fs->id, dir->id, name, vnode->id);