Blame view
include/linux/file.h
1.14 KB
1da177e4c
|
1 2 3 4 5 6 |
/* * Wrapper functions for accessing the file_struct fd array. */ #ifndef __LINUX_FILE_H #define __LINUX_FILE_H |
1da177e4c
|
7 |
#include <linux/compiler.h> |
0c9e63fd3
|
8 |
#include <linux/types.h> |
9f3acc314
|
9 |
#include <linux/posix_types.h> |
1da177e4c
|
10 |
|
9f3acc314
|
11 |
struct file; |
8b7d91eb7
|
12 |
|
b3c975286
|
13 |
extern void fput(struct file *); |
aceaf78da
|
14 |
extern void drop_file_write_access(struct file *file); |
1da177e4c
|
15 |
|
ce8d2cdf3
|
16 17 18 |
struct file_operations; struct vfsmount; struct dentry; |
2c48b9c45
|
19 20 21 |
struct path; extern struct file *alloc_file(struct path *, fmode_t mode, const struct file_operations *fop); |
ce8d2cdf3
|
22 |
|
1da177e4c
|
23 24 |
static inline void fput_light(struct file *file, int fput_needed) { |
c2b3e74b7
|
25 |
if (fput_needed) |
1da177e4c
|
26 27 |
fput(file); } |
b3c975286
|
28 29 |
extern struct file *fget(unsigned int fd); extern struct file *fget_light(unsigned int fd, int *fput_needed); |
1abf0c718
|
30 31 |
extern struct file *fget_raw(unsigned int fd); extern struct file *fget_raw_light(unsigned int fd, int *fput_needed); |
b3c975286
|
32 |
extern void set_close_on_exec(unsigned int fd, int flag); |
1da177e4c
|
33 |
extern void put_filp(struct file *); |
1027abe88
|
34 |
extern int alloc_fd(unsigned start, unsigned flags); |
1da177e4c
|
35 |
extern int get_unused_fd(void); |
1027abe88
|
36 |
#define get_unused_fd_flags(flags) alloc_fd(0, (flags)) |
b3c975286
|
37 |
extern void put_unused_fd(unsigned int fd); |
1da177e4c
|
38 |
|
b3c975286
|
39 |
extern void fd_install(unsigned int fd, struct file *file); |
1da177e4c
|
40 |
|
1da177e4c
|
41 |
#endif /* __LINUX_FILE_H */ |