/DragonOS-0.1.2/kernel/src/filesystem/VFS/ |
D | dcache.c | 13 int vfs_dentry_put(struct vfs_dir_entry_t *dentry) in vfs_dentry_put() argument 18 const struct vfs_dir_entry_t *start_dentry = dentry; in vfs_dentry_put() 21 if (unlikely(dentry->lockref.count > 1)) in vfs_dentry_put() 28 if (D_ISDIR(dentry)) in vfs_dentry_put() 40 in_value = (uint64_t)dentry; in vfs_dentry_put() 42 list_del(&dentry->child_node_list); // 从父dentry中删除 in vfs_dentry_put() 47 kfifo_out(&fifo, &dentry, sizeof(uint64_t)); in vfs_dentry_put() 48 BUG_ON(dentry == NULL); in vfs_dentry_put() 49 struct List *list = &dentry->subdirs_list; in vfs_dentry_put() 60 } while (list_next(list) != (&dentry->subdirs_list)); in vfs_dentry_put() [all …]
|
D | mount.h | 11 struct vfs_dir_entry_t *dentry; // 被挂载前,当前目录项的dentry member 37 int do_umount(struct vfs_dir_entry_t *dentry); 47 static inline void dont_mount(struct vfs_dir_entry_t *dentry) in dont_mount() argument 50 dentry->d_flags |= VFS_DF_CANNOT_MOUNT; in dont_mount() 53 static inline void detach_mounts(struct vfs_dir_entry_t *dentry) in detach_mounts() argument 55 if (!D_MOUNTED(dentry)) in detach_mounts() 68 struct mountpoint *mount_find_mnt_list_by_parent(struct vfs_dir_entry_t *dentry);
|
D | VFS.c | 113 static struct vfs_dir_entry_t *vfs_search_dentry_list(struct vfs_dir_entry_t *dentry, const char *n… in vfs_search_dentry_list() argument 115 if (list_empty(&dentry->subdirs_list)) in vfs_search_dentry_list() 118 struct List *ptr = &dentry->subdirs_list; in vfs_search_dentry_list() 126 } while (list_next(ptr) != (&dentry->subdirs_list)); in vfs_search_dentry_list() 149 struct vfs_dir_entry_t *dentry = NULL; in vfs_path_walk() local 164 dentry = vfs_search_dentry_list(parent, tmpname); in vfs_path_walk() 170 if (dentry == NULL) in vfs_path_walk() 172 dentry = vfs_alloc_dentry(tmp_path_len + 1); in vfs_path_walk() 174 memcpy(dentry->name, (void *)tmp_path, tmp_path_len); in vfs_path_walk() 175 dentry->name[tmp_path_len] = '\0'; in vfs_path_walk() [all …]
|
D | internal.h | 16 int vfs_may_delete(struct vfs_dir_entry_t *dentry, bool isdir); 18 #define D_ISDIR(dentry) ((dentry)->dir_inode->attribute & VFS_IF_DIR) argument 28 static inline bool is_local_mountpoint(struct vfs_dir_entry_t *dentry) in is_local_mountpoint() argument 30 if (D_MOUNTED(dentry)) in is_local_mountpoint()
|
D | mount.c | 30 mp->dentry = old_dentry; in do_mount() 58 int do_umount(struct vfs_dir_entry_t *dentry) in do_umount() argument 71 struct mountpoint *mount_find_mnt_list_by_parent(struct vfs_dir_entry_t *dentry) in mount_find_mnt_list_by_parent() argument 82 if (dentry == tmp->parent_dentry) in mount_find_mnt_list_by_parent()
|
D | VFS.h | 167 long (*unlink)(struct vfs_index_node_t *inode, struct vfs_dir_entry_t *dentry); 289 int vfs_dentry_put(struct vfs_dir_entry_t *dentry); 291 … user_namespace *mnt_userns, struct vfs_index_node_t *parent_inode, struct vfs_dir_entry_t *dentry,
|
/DragonOS-0.1.2/kernel/src/filesystem/devfs/ |
D | internal.h | 72 static inline void __devfs_fill_inode(struct vfs_dir_entry_t *dentry, struct vfs_index_node_t *inod… in __devfs_fill_inode() argument 74 dentry->dir_inode = inode; in __devfs_fill_inode() 75 dentry->dir_inode->file_ops = private_inode_data->f_ops; in __devfs_fill_inode() 76 dentry->dir_inode->inode_ops = &devfs_inode_ops; in __devfs_fill_inode() 78 dentry->dir_inode->private_inode_info = private_inode_data; in __devfs_fill_inode() 79 dentry->dir_inode->sb = &devfs_sb; in __devfs_fill_inode() 80 dentry->dir_inode->attribute = inode_attr; in __devfs_fill_inode() 82 private_inode_data->inode = dentry->dir_inode; in __devfs_fill_inode() 91 static inline void __devfs_fill_dentry(struct vfs_dir_entry_t *dentry, const char *name) in __devfs_fill_dentry() argument 93 strcpy(dentry->name, name); in __devfs_fill_dentry() [all …]
|
D | chardev.c | 59 struct vfs_dir_entry_t *dentry = vfs_alloc_dentry(namelen + 1); in __devfs_chardev_register() local 60 __devfs_fill_dentry(dentry, devname); in __devfs_chardev_register() 61 __devfs_fill_inode(dentry, vfs_alloc_inode(), VFS_IF_DEVICE, private_info); in __devfs_chardev_register() 64 __devfs_dentry_bind_parent(chardev_folder_dentry, dentry); in __devfs_chardev_register() 68 *target_dentry = dentry; in __devfs_chardev_register()
|
D | devfs.c | 87 struct vfs_dir_entry_t *dentry = file_ptr->dEntry; in devfs_readdir() local 88 struct List *list = &dentry->subdirs_list; in devfs_readdir() 93 if (list == &dentry->subdirs_list) // 找完了 in devfs_readdir() 234 struct vfs_dir_entry_t *dentry = NULL; // 该指针由对应类型设备的注册函数设置 in devfs_register_device() local 239 retval = __devfs_chardev_register(private_info, &dentry); in devfs_register_device()
|
/DragonOS-0.1.2/kernel/src/filesystem/rootfs/ |
D | rootfs.c | 14 static inline void __release_dentry(struct vfs_dir_entry_t *dentry) in __release_dentry() argument 16 kfree(dentry->name); in __release_dentry() 17 kfree(dentry); in __release_dentry() 54 struct vfs_dir_entry_t *dentry = file_ptr->dEntry; in rootfs_readdir() local 55 struct List *list = &dentry->subdirs_list; in rootfs_readdir() 60 if (list == &dentry->subdirs_list) // 找完了 in rootfs_readdir() 127 struct vfs_dir_entry_t *dentry = vfs_alloc_dentry(strlen(name) + 1); in rootfs_add_dir() local 128 strcpy(dentry->name, name); in rootfs_add_dir() 129 dentry->name_length = strlen(name); in rootfs_add_dir() 130 dentry->parent = rootfs_sb.root; in rootfs_add_dir() [all …]
|
/DragonOS-0.1.2/docs/kernel/filesystem/vfs/ |
D | overview.md | 9 ### dentry对象 11   dentry的全称为directory entry,是VFS中对于目录项的一种抽象数据结构。当读取具体文件系统时,将会由创建dentry对象。dentry对象中包含了指向in… 13   dentry对象为真实文件系统上的目录结构建立了缓存,一旦内存中存在对应路径的dentry对象,我们就能直接获取其中的信息,而不需要进行费时的磁盘操作。请注意,dentry只… 17 …index node,即索引节点。一般来说,每个dentry都应当包含指向其inode的指针。inode是VFS提供的对文件对象的抽象。inode中的信息是从具体文件系统中读取而来,也可以被刷回具… 23   当一个进程试图通过VFS打开某个文件时,我们需要为这个进程创建文件描述符对象。每个文件对象都会绑定文件的dentry和文件操作方法结构体,还有文件对象的私有信息。 100   该具体文件系统的根目录的dentry
|
/DragonOS-0.1.2/docs/kernel/filesystem/rootfs/ |
D | index.md | 5   rootfs的初始化将与VFS一同初始化。rootfs将为系统的各项文件系统的挂载创建dentry,使得其他的文件系统如`devfs`等,能在磁盘文件系统被挂载之前被正确的初…
|
/DragonOS-0.1.2/kernel/src/filesystem/fat32/ |
D | fat32.c | 1121 int64_t fat32_unlink(struct vfs_index_node_t *dir, struct vfs_dir_entry_t *dentry) in fat32_unlink() argument 1125 struct vfs_index_node_t *inode_to_remove = dentry->dir_inode; in fat32_unlink() 1130 retval = vfat_find(dir, dentry->name, &sinfo); in fat32_unlink() 1139 retval = fat32_detach_inode(dentry->dir_inode); in fat32_unlink() 1200 struct fat32_Directory_t *dentry = NULL; in fat32_readdir() local 1204 dentry = (struct fat32_Directory_t *)(buf + file_ptr->position % fsbi->bytes_per_clus); in fat32_readdir() 1209 i += 32, file_ptr->position += 32, ++dentry) in fat32_readdir() 1212 if (dentry->DIR_Attr == ATTR_LONG_NAME) in fat32_readdir() 1215 … if (dentry->DIR_Name[0] == 0xe5 || dentry->DIR_Name[0] == 0x00 || dentry->DIR_Name[0] == 0x05) in fat32_readdir() 1220 long_dentry = (struct fat32_LongDirectory_t *)(dentry - 1); in fat32_readdir() [all …]
|
/DragonOS-0.1.2/kernel/src/filesystem/procfs/ |
D | procfs.c | 274 struct vfs_dir_entry_t *dentry = file_ptr->dEntry; in procfs_readdir() local 275 struct List *list = &dentry->subdirs_list; in procfs_readdir() 280 if (list == &dentry->subdirs_list) // 找完了 in procfs_readdir() 481 struct vfs_dir_entry_t *dentry = vfs_path_walk(path, 0); in proc_create_file() local 489 dentry->dir_inode->private_inode_info = (void *)finode; in proc_create_file()
|
/DragonOS-0.1.2/kernel/src/process/ |
D | process.c | 134 struct vfs_dir_entry_t *dentry = NULL; in process_open_exec_file() local 137 dentry = vfs_path_walk(path, 0); in process_open_exec_file() 139 if (dentry == NULL) in process_open_exec_file() 142 if (dentry->dir_inode->attribute == VFS_IF_DIR) in process_open_exec_file() 151 filp->dEntry = dentry; in process_open_exec_file() 153 filp->file_ops = dentry->dir_inode->file_ops; in process_open_exec_file()
|
/DragonOS-0.1.2/kernel/src/syscall/ |
D | syscall.c | 405 struct vfs_dir_entry_t *dentry = vfs_path_walk(path, 0); in sys_chdir() local 409 if (dentry == NULL) in sys_chdir() 413 if (dentry->dir_inode->attribute != VFS_IF_DIR) in sys_chdir()
|