diff options
Diffstat (limited to 'include/linux/file.h')
-rw-r--r-- | include/linux/file.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/include/linux/file.h b/include/linux/file.h index 74183e6f7f45..a59001e9ea58 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -26,19 +26,12 @@ struct embedded_fd_set { | |||
26 | unsigned long fds_bits[1]; | 26 | unsigned long fds_bits[1]; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | /* | ||
30 | * More than this number of fds: we use a separately allocated fd_set | ||
31 | */ | ||
32 | #define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set)) | ||
33 | |||
34 | struct fdtable { | 29 | struct fdtable { |
35 | unsigned int max_fds; | 30 | unsigned int max_fds; |
36 | int max_fdset; | ||
37 | struct file ** fd; /* current fd array */ | 31 | struct file ** fd; /* current fd array */ |
38 | fd_set *close_on_exec; | 32 | fd_set *close_on_exec; |
39 | fd_set *open_fds; | 33 | fd_set *open_fds; |
40 | struct rcu_head rcu; | 34 | struct rcu_head rcu; |
41 | struct files_struct *free_files; | ||
42 | struct fdtable *next; | 35 | struct fdtable *next; |
43 | }; | 36 | }; |
44 | 37 | ||
@@ -64,6 +57,8 @@ struct files_struct { | |||
64 | 57 | ||
65 | #define files_fdtable(files) (rcu_dereference((files)->fdt)) | 58 | #define files_fdtable(files) (rcu_dereference((files)->fdt)) |
66 | 59 | ||
60 | extern struct kmem_cache *filp_cachep; | ||
61 | |||
67 | extern void FASTCALL(__fput(struct file *)); | 62 | extern void FASTCALL(__fput(struct file *)); |
68 | extern void FASTCALL(fput(struct file *)); | 63 | extern void FASTCALL(fput(struct file *)); |
69 | 64 | ||
@@ -81,16 +76,15 @@ extern int get_unused_fd(void); | |||
81 | extern void FASTCALL(put_unused_fd(unsigned int fd)); | 76 | extern void FASTCALL(put_unused_fd(unsigned int fd)); |
82 | struct kmem_cache; | 77 | struct kmem_cache; |
83 | 78 | ||
84 | extern struct file ** alloc_fd_array(int); | ||
85 | extern void free_fd_array(struct file **, int); | ||
86 | |||
87 | extern fd_set *alloc_fdset(int); | ||
88 | extern void free_fdset(fd_set *, int); | ||
89 | |||
90 | extern int expand_files(struct files_struct *, int nr); | 79 | extern int expand_files(struct files_struct *, int nr); |
91 | extern void free_fdtable(struct fdtable *fdt); | 80 | extern void free_fdtable_rcu(struct rcu_head *rcu); |
92 | extern void __init files_defer_init(void); | 81 | extern void __init files_defer_init(void); |
93 | 82 | ||
83 | static inline void free_fdtable(struct fdtable *fdt) | ||
84 | { | ||
85 | call_rcu(&fdt->rcu, free_fdtable_rcu); | ||
86 | } | ||
87 | |||
94 | static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) | 88 | static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) |
95 | { | 89 | { |
96 | struct file * file = NULL; | 90 | struct file * file = NULL; |
@@ -114,4 +108,6 @@ struct files_struct *get_files_struct(struct task_struct *); | |||
114 | void FASTCALL(put_files_struct(struct files_struct *fs)); | 108 | void FASTCALL(put_files_struct(struct files_struct *fs)); |
115 | void reset_files_struct(struct task_struct *, struct files_struct *); | 109 | void reset_files_struct(struct task_struct *, struct files_struct *); |
116 | 110 | ||
111 | extern struct kmem_cache *files_cachep; | ||
112 | |||
117 | #endif /* __LINUX_FILE_H */ | 113 | #endif /* __LINUX_FILE_H */ |