Make do_dup() static and move relevant macros to kern_descrip.c

No functional changes.
This commit is contained in:
Mateusz Guzik 2014-09-26 19:48:47 +00:00
parent db25c97a1a
commit 0c4a09a378
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272185
2 changed files with 8 additions and 8 deletions

View File

@ -101,6 +101,8 @@ static uma_zone_t file_zone;
static int closefp(struct filedesc *fdp, int fd, struct file *fp,
struct thread *td, int holdleaders);
static int do_dup(struct thread *td, int flags, int old, int new,
register_t *retval);
static int fd_first_free(struct filedesc *fdp, int low, int size);
static int fd_last_used(struct filedesc *fdp, int size);
static void fdgrowtable(struct filedesc *fdp, int nfd);
@ -109,6 +111,11 @@ static void fdunused(struct filedesc *fdp, int fd);
static void fdused(struct filedesc *fdp, int fd);
static int getmaxfd(struct proc *p);
/* Flags for do_dup() */
#define DUP_FIXED 0x1 /* Force fixed allocation. */
#define DUP_FCNTL 0x2 /* fcntl()-style errors. */
#define DUP_CLOEXEC 0x4 /* Atomically set FD_CLOEXEC. */
/*
* Each process has:
*
@ -785,7 +792,7 @@ getmaxfd(struct proc *p)
/*
* Common code for dup, dup2, fcntl(F_DUPFD) and fcntl(F_DUP2FD).
*/
int
static int
do_dup(struct thread *td, int flags, int old, int new,
register_t *retval)
{

View File

@ -109,11 +109,6 @@ struct filedesc_to_leader {
#ifdef _KERNEL
/* Flags for do_dup() */
#define DUP_FIXED 0x1 /* Force fixed allocation. */
#define DUP_FCNTL 0x2 /* fcntl()-style errors. */
#define DUP_CLOEXEC 0x4 /* Atomically set FD_CLOEXEC. */
/* Lock a file descriptor table. */
#define FILEDESC_LOCK_INIT(fdp) sx_init(&(fdp)->fd_sx, "filedesc structure")
#define FILEDESC_LOCK_DESTROY(fdp) sx_destroy(&(fdp)->fd_sx)
@ -137,8 +132,6 @@ void filecaps_move(struct filecaps *src, struct filecaps *dst);
void filecaps_free(struct filecaps *fcaps);
int closef(struct file *fp, struct thread *td);
int do_dup(struct thread *td, int flags, int old, int new,
register_t *retval);
int dupfdopen(struct thread *td, struct filedesc *fdp, int dfd, int mode,
int openerror, int *indxp);
int falloc(struct thread *td, struct file **resultfp, int *resultfd,