aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/file.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/file.h')
-rw-r--r--include/linux/file.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/include/linux/file.h b/include/linux/file.h
index 6e77b9177f9e..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
34struct fdtable { 29struct 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
@@ -83,16 +76,15 @@ extern int get_unused_fd(void);
83extern void FASTCALL(put_unused_fd(unsigned int fd)); 76extern void FASTCALL(put_unused_fd(unsigned int fd));
84struct kmem_cache; 77struct kmem_cache;
85 78
86extern struct file ** alloc_fd_array(int);
87extern void free_fd_array(struct file **, int);
88
89extern fd_set *alloc_fdset(int);
90extern void free_fdset(fd_set *, int);
91
92extern int expand_files(struct files_struct *, int nr); 79extern int expand_files(struct files_struct *, int nr);
93extern void free_fdtable(struct fdtable *fdt); 80extern void free_fdtable_rcu(struct rcu_head *rcu);
94extern void __init files_defer_init(void); 81extern void __init files_defer_init(void);
95 82
83static inline void free_fdtable(struct fdtable *fdt)
84{
85 call_rcu(&fdt->rcu, free_fdtable_rcu);
86}
87
96static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) 88static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
97{ 89{
98 struct file * file = NULL; 90 struct file * file = NULL;