fs: allocate file/socket dynamically

Change-Id: I8aea63eaf0275f47f21fc8d5482b51ffecd5c906
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong
2021-03-16 20:13:02 +08:00
committed by Xiang Xiao
parent 59eb4fa8d6
commit e96c8b9283
35 changed files with 760 additions and 599 deletions
+10 -5
View File
@@ -70,18 +70,23 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
FAR struct file_struct *filep;
#endif
int i;
int j;
sinfo(" TCB=%p name=%s\n", tcb, tcb->argv[0]);
sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
filelist = tcb->group->tg_filelist;
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
for (i = 0; i < filelist->fl_rows; i++)
{
struct inode *inode = filelist->fl_files[i].f_inode;
if (inode)
for (j = 0; j < CONFIG_NFILE_DESCRIPTORS_PER_BLOCK; j++)
{
sinfo(" fd=%d refcount=%d\n",
i, inode->i_crefs);
struct inode *inode = filelist->fl_files[i][j].f_inode;
if (inode)
{
sinfo(" fd=%d refcount=%d\n",
i * CONFIG_NFILE_DESCRIPTORS_PER_BLOCK + j,
inode->i_crefs);
}
}
}