Lines Matching full:fd

3  * Wrapper functions for accessing the file_struct fd array.
38 struct fd { struct
45 static inline bool fd_empty(struct fd f) in fd_empty() argument
50 #define EMPTY_FD (struct fd){0}
51 static inline struct fd BORROWED_FD(struct file *f) in BORROWED_FD()
53 return (struct fd){(unsigned long)f}; in BORROWED_FD()
55 static inline struct fd CLONED_FD(struct file *f) in CLONED_FD()
57 return (struct fd){(unsigned long)f | FDPUT_FPUT}; in CLONED_FD()
60 static inline void fdput(struct fd fd) in fdput() argument
62 if (fd.word & FDPUT_FPUT) in fdput()
63 fput(fd_file(fd)); in fdput()
66 extern struct file *fget(unsigned int fd);
67 extern struct file *fget_raw(unsigned int fd);
68 extern struct file *fget_task(struct task_struct *task, unsigned int fd);
69 extern struct file *fget_task_next(struct task_struct *task, unsigned int *fd);
72 struct fd fdget(unsigned int fd);
73 struct fd fdget_raw(unsigned int fd);
74 struct fd fdget_pos(unsigned int fd);
76 static inline void fdput_pos(struct fd f) in fdput_pos()
83 DEFINE_CLASS(fd, struct fd, fdput(_T), fdget(fd), int fd)
84 DEFINE_CLASS(fd_raw, struct fd, fdput(_T), fdget_raw(fd), int fd)
85 DEFINE_CLASS(fd_pos, struct fd, fdput_pos(_T), fdget_pos(fd), int fd)
88 extern int replace_fd(unsigned fd, struct file *file, unsigned flags);
89 extern void set_close_on_exec(unsigned int fd, int flag);
90 extern bool get_close_on_exec(unsigned int fd);
93 extern void put_unused_fd(unsigned int fd);
100 * take_fd() will take care to set @fd to -EBADF ensuring that
106 * CLASS(get_unused_fd, fd)(O_CLOEXEC);
107 * if (fd < 0)
108 * return fd;
114 * fd_install(fd, f);
115 * return take_fd(fd);
117 #define take_fd(fd) __get_and_null(fd, -EBADF) argument
119 extern void fd_install(unsigned int fd, struct file *file);