Lines Matching refs:list

16  *    notice, this list of conditions and the following disclaimer.
18 * notice, this list of conditions and the following disclaimer in
125 static void _files_semtake(struct filelist *list)
129 while (sem_wait(&list->fl_sem) != 0)
143 #define _files_semgive(list) (void)sem_post(&list->fl_sem)
147 struct filelist *list = sched_getfiles();
148 if (!list)
153 _files_semtake(list);
159 _files_semgive(list);
164 struct filelist *list = sched_getfiles();
165 if (!list)
170 _files_semtake(list);
176 _files_semgive(list);
186 * Caller holds the list semaphore because the file descriptor will be freed.
258 * Description: Initializes the list of files for a new task
262 void files_initlist(struct filelist *list)
264 DEBUGASSERT(list);
266 /* Initialize the list access mutex */
268 (void)sem_init(&list->fl_sem, 0, 1);
275 * Release a reference to the file list
279 void files_releaselist(struct filelist *list)
283 DEBUGASSERT(list);
285 /* Close each file descriptor .. Normally, you would need take the list
292 (void)_files_close(&list->fl_files[i]);
297 (void)sem_destroy(&list->fl_sem);
319 struct filelist *list = NULL;
330 list = sched_getfiles();
331 DEBUGASSERT(list);
332 /* The file list can be NULL under two cases: (1) One is an obscure
339 if (list != NULL)
341 _files_semtake(list);
401 if (list != NULL)
403 _files_semgive(list);
415 _files_semgive(list);
424 struct filelist *list = NULL;
436 list = sched_getfiles();
437 DEBUGASSERT(list);
439 _files_semtake(list);
448 filep = &list->fl_files[i];
459 _files_semgive(list);
465 _files_semgive(list);
472 struct filelist *list = NULL;
481 /* Get the thread-specific file list. It should never be NULL in this
485 list = sched_getfiles();
486 DEBUGASSERT(list != NULL);
490 if (fd < 0 || fd >= CONFIG_NFILE_DESCRIPTORS || !list->fl_files[fd].f_vnode)
497 _files_semtake(list);
502 _files_semgive(list);
506 list->fl_files[fd].f_refcount--;
507 if (list->fl_files[fd].f_refcount == 0)
509 ret = _files_close(&list->fl_files[fd]);
516 _files_semgive(list);
527 * Caller holds the list semaphore because the file descriptor will be freed.
547 struct filelist *list = NULL;
549 list = sched_getfiles();
550 DEBUGASSERT(list);
554 _files_semtake(list);
555 struct file *filep = &list->fl_files[fd];
560 _files_semgive(list);
566 struct filelist *list = NULL;
570 list = sched_getfiles();
571 DEBUGASSERT(list);
580 return list->fl_files[fd].f_vnode;
585 struct filelist *list = NULL;
598 list = sched_getfiles();
599 DEBUGASSERT(list);
601 _files_semtake(list);
610 _files_semgive(list);
615 _files_semgive(list);
650 struct filelist *list = sched_getfiles();
651 if (!list || fd < 0 || fd >= CONFIG_NFILE_DESCRIPTORS)
656 _files_semtake(list);
662 _files_semgive(list);