diff options
Diffstat (limited to 'include/linux/fdtable.h')
| -rw-r--r-- | include/linux/fdtable.h | 39 |
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 | ||
| 33 | static inline void __set_close_on_exec(int fd, struct fdtable *fdt) | ||
| 34 | { | ||
| 35 | __set_bit(fd, fdt->close_on_exec); | ||
| 36 | } | ||
| 37 | |||
| 38 | static inline void __clear_close_on_exec(int fd, struct fdtable *fdt) | ||
| 39 | { | ||
| 40 | __clear_bit(fd, fdt->close_on_exec); | ||
| 41 | } | ||
| 42 | |||
| 43 | static inline bool close_on_exec(int fd, const struct fdtable *fdt) | 33 | static 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 | ||
| 48 | static inline void __set_open_fd(int fd, struct fdtable *fdt) | ||
| 49 | { | ||
| 50 | __set_bit(fd, fdt->open_fds); | ||
| 51 | } | ||
| 52 | |||
| 53 | static inline void __clear_open_fd(int fd, struct fdtable *fdt) | ||
| 54 | { | ||
| 55 | __clear_bit(fd, fdt->open_fds); | ||
| 56 | } | ||
| 57 | |||
| 58 | static inline bool fd_is_open(int fd, const struct fdtable *fdt) | 38 | static 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; | |||
| 93 | struct vfsmount; | 73 | struct vfsmount; |
| 94 | struct dentry; | 74 | struct dentry; |
| 95 | 75 | ||
| 96 | extern int expand_files(struct files_struct *, int nr); | ||
| 97 | extern void free_fdtable_rcu(struct rcu_head *rcu); | ||
| 98 | extern void __init files_defer_init(void); | 76 | extern void __init files_defer_init(void); |
| 99 | 77 | ||
| 100 | static inline void free_fdtable(struct fdtable *fdt) | ||
| 101 | { | ||
| 102 | call_rcu(&fdt->rcu, free_fdtable_rcu); | ||
| 103 | } | ||
| 104 | |||
| 105 | static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) | 78 | static 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; | |||
| 122 | struct files_struct *get_files_struct(struct task_struct *); | 95 | struct files_struct *get_files_struct(struct task_struct *); |
| 123 | void put_files_struct(struct files_struct *fs); | 96 | void put_files_struct(struct files_struct *fs); |
| 124 | void reset_files_struct(struct files_struct *); | 97 | void reset_files_struct(struct files_struct *); |
| 98 | void daemonize_descriptors(void); | ||
| 125 | int unshare_files(struct files_struct **); | 99 | int unshare_files(struct files_struct **); |
| 126 | struct files_struct *dup_fd(struct files_struct *, int *); | 100 | struct files_struct *dup_fd(struct files_struct *, int *); |
| 101 | void do_close_on_exec(struct files_struct *); | ||
| 102 | int iterate_fd(struct files_struct *, unsigned, | ||
| 103 | int (*)(const void *, struct file *, unsigned), | ||
| 104 | const void *); | ||
| 105 | |||
| 106 | extern int __alloc_fd(struct files_struct *files, | ||
| 107 | unsigned start, unsigned end, unsigned flags); | ||
| 108 | extern void __fd_install(struct files_struct *files, | ||
| 109 | unsigned int fd, struct file *file); | ||
| 110 | extern int __close_fd(struct files_struct *files, | ||
| 111 | unsigned int fd); | ||
| 127 | 112 | ||
| 128 | extern struct kmem_cache *files_cachep; | 113 | extern struct kmem_cache *files_cachep; |
| 129 | 114 | ||
