1 /*
2 * linux/fs/file_table.c
3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 */
6
7 #include <linux/fs.h>
8 #include <linux/string.h>
9
10 struct file file_table[NR_FILE];
11
12 struct file * get_empty_filp(void)
/* ![[previous]](../icons/n_left.png)
![[next]](../icons/n_right.png)
![[first]](../icons/n_first.png)
![[last]](../icons/n_last.png)
![[top]](../icons/top.png)
![[bottom]](../icons/bottom.png)
![[index]](../icons/index.png)
*/
13 {
14 int i;
15 struct file * f = file_table+0;
16
17 for (i = 0; i++ < NR_FILE; f++)
18 if (!f->f_count) {
19 memset(f,0,sizeof(*f));
20 f->f_count = 1;
21 return f;
22 }
23 return NULL;
24 }