aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fdtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fdtable.h')
-rw-r--r--include/linux/fdtable.h39
1 files changed, 12 insertions, 27 deletions
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 158a41eed314..45052aa814c8 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -30,31 +30,11 @@ struct fdtable {
30 struct fdtable *next; 30 struct fdtable *next;
31}; 31};
32 32
33static inline void __set_close_on_exec(int fd, struct fdtable *fdt)
34{
35 __set_bit(fd, fdt->close_on_exec);
36}
37
38static inline void __clear_close_on_exec(int fd, struct fdtable *fdt)
39{
40 __clear_bit(fd, fdt->close_on_exec);
41}
42
43static inline bool close_on_exec(int fd, const struct fdtable *fdt) 33static inline bool close_on_exec(int fd, const struct fdtable *fdt)
44{ 34{
45 return test_bit(fd, fdt->close_on_exec); 35 return test_bit(fd, fdt->close_on_exec);
46} 36}
47 37
48static inline void __set_open_fd(int fd, struct fdtable *fdt)
49{
50 __set_bit(fd, fdt->open_fds);
51}
52
53static inline void __clear_open_fd(int fd, struct fdtable *fdt)
54{
55 __clear_bit(fd, fdt->open_fds);
56}
57
58static inline bool fd_is_open(int fd, const struct fdtable *fdt) 38static inline bool fd_is_open(int fd, const struct fdtable *fdt)
59{ 39{
60 return test_bit(fd, fdt->open_fds); 40 return test_bit(fd, fdt->open_fds);
@@ -93,15 +73,8 @@ struct file_operations;
93struct vfsmount; 73struct vfsmount;
94struct dentry; 74struct dentry;
95 75
96extern int expand_files(struct files_struct *, int nr);
97extern void free_fdtable_rcu(struct rcu_head *rcu);
98extern void __init files_defer_init(void); 76extern void __init files_defer_init(void);
99 77
100static inline void free_fdtable(struct fdtable *fdt)
101{
102 call_rcu(&fdt->rcu, free_fdtable_rcu);
103}
104
105static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) 78static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
106{ 79{
107 struct file * file = NULL; 80 struct file * file = NULL;
@@ -122,8 +95,20 @@ struct task_struct;
122struct files_struct *get_files_struct(struct task_struct *); 95struct files_struct *get_files_struct(struct task_struct *);
123void put_files_struct(struct files_struct *fs); 96void put_files_struct(struct files_struct *fs);
124void reset_files_struct(struct files_struct *); 97void reset_files_struct(struct files_struct *);
98void daemonize_descriptors(void);
125int unshare_files(struct files_struct **); 99int unshare_files(struct files_struct **);
126struct files_struct *dup_fd(struct files_struct *, int *); 100struct files_struct *dup_fd(struct files_struct *, int *);
101void do_close_on_exec(struct files_struct *);
102int iterate_fd(struct files_struct *, unsigned,
103 int (*)(const void *, struct file *, unsigned),
104 const void *);
105
106extern int __alloc_fd(struct files_struct *files,
107 unsigned start, unsigned end, unsigned flags);
108extern void __fd_install(struct files_struct *files,
109 unsigned int fd, struct file *file);
110extern int __close_fd(struct files_struct *files,
111 unsigned int fd);
127 112
128extern struct kmem_cache *files_cachep; 113extern struct kmem_cache *files_cachep;
129 114