Skip to content

Commit

Permalink
make get_unused_fd_flags() a function
Browse files Browse the repository at this point in the history
... and get_unused_fd() a macro around it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Sep 27, 2012
1 parent 56b31d1 commit 1a7bd22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ int alloc_fd(unsigned start, unsigned flags)
return error;
}

int get_unused_fd(void)
int get_unused_fd_flags(unsigned flags)
{
return alloc_fd(0, 0);
return alloc_fd(0, flags);
}
EXPORT_SYMBOL(get_unused_fd);
EXPORT_SYMBOL(get_unused_fd_flags);
4 changes: 2 additions & 2 deletions include/linux/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ extern struct file *fget_raw_light(unsigned int fd, int *fput_needed);
extern void set_close_on_exec(unsigned int fd, int flag);
extern void put_filp(struct file *);
extern int alloc_fd(unsigned start, unsigned flags);
extern int get_unused_fd(void);
#define get_unused_fd_flags(flags) alloc_fd(0, (flags))
extern int get_unused_fd_flags(unsigned flags);
#define get_unused_fd() get_unused_fd_flags(0)
extern void put_unused_fd(unsigned int fd);

extern void fd_install(unsigned int fd, struct file *file);
Expand Down

0 comments on commit 1a7bd22

Please sign in to comment.