Lines Matching refs:fds
61 struct dfs_file **fds = NULL; in _fdt_slot_expand() local
77 fds = (struct dfs_file **)rt_realloc(fdt->fds, nr * sizeof(struct dfs_file *)); in _fdt_slot_expand()
78 if (!fds) in _fdt_slot_expand()
86 fds[index] = NULL; in _fdt_slot_expand()
88 fdt->fds = fds; in _fdt_slot_expand()
112 if (fdt->fds[idx] == RT_NULL) in _fdt_slot_alloc()
315 else if (!fdt->fds[idx]) in fdt_fd_new()
323 fdt->fds[idx] = file; in fdt_fd_new()
329 fdt->fds[idx] = RT_NULL; in fdt_fd_new()
367 fdt->fds[fd] = RT_NULL; in fdt_fd_release()
390 f = fdt->fds[fd]; in fdt_get_file()
436 if (fdt->fds[fd]) in fdt_fd_associate_file()
443 fdt->fds[fd] = file; in fdt_fd_associate_file()
593 if (!fdt_src->fds[fd_src]) in dfs_fdtable_dup()
602 fdt_dst->fds[newfd]->mode = fdt_src->fds[fd_src]->mode; in dfs_fdtable_dup()
603 fdt_dst->fds[newfd]->flags = fdt_src->fds[fd_src]->flags; in dfs_fdtable_dup()
604 fdt_dst->fds[newfd]->fops = fdt_src->fds[fd_src]->fops; in dfs_fdtable_dup()
605 fdt_dst->fds[newfd]->dentry = dfs_dentry_ref(fdt_src->fds[fd_src]->dentry); in dfs_fdtable_dup()
606 fdt_dst->fds[newfd]->vnode = fdt_src->fds[fd_src]->vnode; in dfs_fdtable_dup()
607 fdt_dst->fds[newfd]->mmap_context = RT_NULL; in dfs_fdtable_dup()
608 fdt_dst->fds[newfd]->data = fdt_src->fds[fd_src]->data; in dfs_fdtable_dup()
613 if (!fdt_dst->fds[newfd]->dentry) in dfs_fdtable_dup()
615 rt_atomic_add(&(fdt_dst->fds[newfd]->vnode->ref_count), 1); in dfs_fdtable_dup()
648 err = dfs_file_close(fdt->fds[fd]); in dfs_fdtable_drop_fd()
686 if (!fdt->fds[oldfd]) in dfs_dup()
694 fdt->fds[newfd] = fdt->fds[oldfd]; in dfs_dup()
697 rt_atomic_add(&(fdt->fds[newfd]->ref_count), 1); in dfs_dup()
733 if (!fdt->fds[oldfd]) in dfs_dup_to()
741 fdtab->fds[newfd] = fdt->fds[oldfd]; in dfs_dup_to()
744 rt_atomic_add(&(fdtab->fds[newfd]->ref_count), 1); in dfs_dup_to()
780 if (!fdtab->fds[oldfd]) in dfs_dup_from()
789 file->mode = fdtab->fds[oldfd]->mode; in dfs_dup_from()
790 file->flags = fdtab->fds[oldfd]->flags; in dfs_dup_from()
791 file->fops = fdtab->fds[oldfd]->fops; in dfs_dup_from()
792 file->dentry = dfs_dentry_ref(fdtab->fds[oldfd]->dentry); in dfs_dup_from()
793 file->vnode = fdtab->fds[oldfd]->vnode; in dfs_dup_from()
795 file->data = fdtab->fds[oldfd]->data; in dfs_dup_from()
798 dfs_file_close(fdtab->fds[oldfd]); in dfs_dup_from()
862 if (!fdt->fds[oldfd]) in sys_dup2()
878 if (fdt->fds[newfd] == fdt->fds[oldfd]) in sys_dup2()
885 if (fdt->fds[newfd]) in sys_dup2()
887 ret = dfs_file_close(fdt->fds[newfd]); in sys_dup2()
895 fdt->fds[newfd] = fdt->fds[oldfd]; in sys_dup2()
897 rt_atomic_add(&(fdt->fds[newfd]->ref_count), 1); in sys_dup2()
1121 struct dfs_file *file = fd_table->fds[index]; in list_fd()
1171 struct dfs_file *file = _fdtab.fds[index]; in dfs_fd_dump()