Lines Matching refs:fd
29 struct file __rcu **fd; /* current fd array */ member
36 static inline bool close_on_exec(unsigned int fd, const struct fdtable *fdt) in close_on_exec() argument
38 return test_bit(fd, fdt->close_on_exec); in close_on_exec()
41 static inline bool fd_is_open(unsigned int fd, const struct fdtable *fdt) in fd_is_open() argument
43 return test_bit(fd, fdt->open_fds); in fd_is_open()
83 static inline struct file *files_lookup_fd_raw(struct files_struct *files, unsigned int fd) in files_lookup_fd_raw() argument
87 if (fd < fdt->max_fds) { in files_lookup_fd_raw()
88 fd = array_index_nospec(fd, fdt->max_fds); in files_lookup_fd_raw()
89 return rcu_dereference_raw(fdt->fd[fd]); in files_lookup_fd_raw()
94 static inline struct file *files_lookup_fd_locked(struct files_struct *files, unsigned int fd) in files_lookup_fd_locked() argument
98 return files_lookup_fd_raw(files, fd); in files_lookup_fd_locked()
101 static inline struct file *files_lookup_fd_rcu(struct files_struct *files, unsigned int fd) in files_lookup_fd_rcu() argument
105 return files_lookup_fd_raw(files, fd); in files_lookup_fd_rcu()
108 static inline struct file *lookup_fd_rcu(unsigned int fd) in lookup_fd_rcu() argument
110 return files_lookup_fd_rcu(current->files, fd); in lookup_fd_rcu()
113 struct file *task_lookup_fd_rcu(struct task_struct *task, unsigned int fd);
114 struct file *task_lookup_next_fd_rcu(struct task_struct *task, unsigned int *fd);
126 extern int close_fd(unsigned int fd);
127 extern int __close_range(unsigned int fd, unsigned int max_fd, unsigned int flags);
128 extern int close_fd_get_file(unsigned int fd, struct file **res);