Skip to content

Commit

Permalink
remove fl_crefs
Browse files Browse the repository at this point in the history
Signed-off-by: hujun5 <[email protected]>
  • Loading branch information
hujun260 committed Dec 13, 2024
1 parent 5cdc6c7 commit e246cbe
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 47 deletions.
35 changes: 0 additions & 35 deletions fs/inode/fs_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ void files_initlist(FAR struct filelist *list)
*/

list->fl_rows = 1;
list->fl_crefs = 1;
list->fl_files = &list->fl_prefile;
list->fl_prefile = list->fl_prefiles;
spin_lock_init(&list->fl_lock);
Expand Down Expand Up @@ -457,34 +456,6 @@ void files_dumplist(FAR struct filelist *list)
}
#endif

/****************************************************************************
* Name: files_getlist
*
* Description:
* Get the list of files by tcb.
*
* Assumptions:
* Called during task deletion in a safe context.
*
****************************************************************************/

FAR struct filelist *files_getlist(FAR struct tcb_s *tcb)
{
FAR struct filelist *list;

if (tcb->group != NULL)
{
list = &tcb->group->tg_filelist;
if (list->fl_crefs > 0)
{
list->fl_crefs++;
return list;
}
}

return NULL;
}

/****************************************************************************
* Name: files_putlist
*
Expand All @@ -501,12 +472,6 @@ void files_putlist(FAR struct filelist *list)
int i;
int j;

DEBUGASSERT(list->fl_crefs >= 1);
if (--list->fl_crefs > 0)
{
return;
}

/* Close each file descriptor .. Normally, you would need take the list
* mutex, but it is safe to ignore the mutex in this context
* because there should not be any references in this context.
Expand Down
11 changes: 0 additions & 11 deletions include/nuttx/fs/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ struct filelist
{
spinlock_t fl_lock; /* Manage access to the file list */
uint8_t fl_rows; /* The number of rows of fl_files array */
uint8_t fl_crefs; /* The references to filelist */
FAR struct file **fl_files; /* The pointer of two layer file descriptors array */

/* Pre-allocated files to avoid allocator access during thread creation
Expand Down Expand Up @@ -906,16 +905,6 @@ void files_dumplist(FAR struct filelist *list);
# define files_dumplist(l)
#endif

/****************************************************************************
* Name: files_getlist
*
* Description:
* Get the list of files by tcb.
*
****************************************************************************/

FAR struct filelist *files_getlist(FAR struct tcb_s *tcb);

/****************************************************************************
* Name: files_putlist
*
Expand Down
1 change: 0 additions & 1 deletion tools/gdb/nuttxgdb/protocols/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,4 @@ class FileList(Value):
"""struct filelist_s"""

fl_rows: Value
fl_crefs: Value
fl_files: Value

0 comments on commit e246cbe

Please sign in to comment.