diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-12 17:18:05 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 21:08:50 -0400 |
commit | 1a7bd2265fc57f29400d57f66275cc5918e30aa6 (patch) | |
tree | 48a4bb42dfb5d4b37d077bbaf550253686b546f5 | |
parent | 56b31d1c9f1e6a3ad92e7bfe252721e05d92b285 (diff) |
make get_unused_fd_flags() a function
... and get_unused_fd() a macro around it
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/file.c | 6 | ||||
-rw-r--r-- | include/linux/file.h | 4 |
2 files changed, 5 insertions, 5 deletions
@@ -477,8 +477,8 @@ out: | |||
477 | return error; | 477 | return error; |
478 | } | 478 | } |
479 | 479 | ||
480 | int get_unused_fd(void) | 480 | int get_unused_fd_flags(unsigned flags) |
481 | { | 481 | { |
482 | return alloc_fd(0, 0); | 482 | return alloc_fd(0, flags); |
483 | } | 483 | } |
484 | EXPORT_SYMBOL(get_unused_fd); | 484 | EXPORT_SYMBOL(get_unused_fd_flags); |
diff --git a/include/linux/file.h b/include/linux/file.h index a22408bac0d0..86795ec6027d 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -33,8 +33,8 @@ extern struct file *fget_raw_light(unsigned int fd, int *fput_needed); | |||
33 | extern void set_close_on_exec(unsigned int fd, int flag); | 33 | extern void set_close_on_exec(unsigned int fd, int flag); |
34 | extern void put_filp(struct file *); | 34 | extern void put_filp(struct file *); |
35 | extern int alloc_fd(unsigned start, unsigned flags); | 35 | extern int alloc_fd(unsigned start, unsigned flags); |
36 | extern int get_unused_fd(void); | 36 | extern int get_unused_fd_flags(unsigned flags); |
37 | #define get_unused_fd_flags(flags) alloc_fd(0, (flags)) | 37 | #define get_unused_fd() get_unused_fd_flags(0) |
38 | extern void put_unused_fd(unsigned int fd); | 38 | extern void put_unused_fd(unsigned int fd); |
39 | 39 | ||
40 | extern void fd_install(unsigned int fd, struct file *file); | 40 | extern void fd_install(unsigned int fd, struct file *file); |