Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove fl_crefs #15180

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading