From owner-svn-src-head@FreeBSD.ORG Fri Sep 26 19:48:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7B9924B; Fri, 26 Sep 2014 19:48:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3AAC2A; Fri, 26 Sep 2014 19:48:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QJmmHb046669; Fri, 26 Sep 2014 19:48:48 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QJmmmk046664; Fri, 26 Sep 2014 19:48:48 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201409261948.s8QJmmmk046664@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 26 Sep 2014 19:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272185 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 19:48:48 -0000 Author: mjg Date: Fri Sep 26 19:48:47 2014 New Revision: 272185 URL: http://svnweb.freebsd.org/changeset/base/272185 Log: Make do_dup() static and move relevant macros to kern_descrip.c No functional changes. Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Sep 26 19:13:13 2014 (r272184) +++ head/sys/kern/kern_descrip.c Fri Sep 26 19:48:47 2014 (r272185) @@ -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 *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) { Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Fri Sep 26 19:13:13 2014 (r272184) +++ head/sys/sys/filedesc.h Fri Sep 26 19:48:47 2014 (r272185) @@ -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, 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,