Lines Matching refs:fd
3 * Wrapper functions for accessing the file_struct fd array.
38 struct fd {
45 static inline void fdput(struct fd fd)
47 if (fd.flags & FDPUT_FPUT)
48 fput(fd.file);
51 extern struct file *fget(unsigned int fd);
52 extern struct file *fget_raw(unsigned int fd);
53 extern struct file *fget_task(struct task_struct *task, unsigned int fd);
54 extern unsigned long __fdget(unsigned int fd);
55 extern unsigned long __fdget_raw(unsigned int fd);
56 extern unsigned long __fdget_pos(unsigned int fd);
59 static inline struct fd __to_fd(unsigned long v)
61 return (struct fd){(struct file *)(v & ~3),v & 3};
64 static inline struct fd fdget(unsigned int fd)
66 return __to_fd(__fdget(fd));
69 static inline struct fd fdget_raw(unsigned int fd)
71 return __to_fd(__fdget_raw(fd));
74 static inline struct fd fdget_pos(int fd)
76 return __to_fd(__fdget_pos(fd));
79 static inline void fdput_pos(struct fd f)
86 DEFINE_CLASS(fd, struct fd, fdput(_T), fdget(fd), int fd)
89 extern int replace_fd(unsigned fd, struct file *file, unsigned flags);
90 extern void set_close_on_exec(unsigned int fd, int flag);
91 extern bool get_close_on_exec(unsigned int fd);
94 extern void put_unused_fd(unsigned int fd);
99 extern void fd_install(unsigned int fd, struct file *file);