Author: kib
Date: Fri Apr  1 13:28:34 2011
New Revision: 220245
URL: http://svn.freebsd.org/changeset/base/220245

Log:
  After the r219999 is merged to stable/8, rename fallocf(9) to falloc(9)
  and remove the falloc() version that lacks flag argument. This is done
  to reduce the KPI bloat.
  
  Requested by: jhb
  X-MFC-note:   do not

Modified:
  head/sys/dev/streams/streams.c
  head/sys/kern/kern_descrip.c
  head/sys/kern/kern_event.c
  head/sys/kern/sys_pipe.c
  head/sys/kern/tty_pts.c
  head/sys/kern/uipc_mqueue.c
  head/sys/kern/uipc_sem.c
  head/sys/kern/uipc_shm.c
  head/sys/kern/uipc_syscalls.c
  head/sys/kern/vfs_syscalls.c
  head/sys/opencrypto/cryptodev.c
  head/sys/sys/filedesc.h

Modified: head/sys/dev/streams/streams.c
==============================================================================
--- head/sys/dev/streams/streams.c      Fri Apr  1 13:23:53 2011        
(r220244)
+++ head/sys/dev/streams/streams.c      Fri Apr  1 13:28:34 2011        
(r220245)
@@ -241,7 +241,7 @@ streamsopen(struct cdev *dev, int oflags
        }
 
        fdp = td->td_proc->p_fd;
-       if ((error = falloc(td, &fp, &fd)) != 0)
+       if ((error = falloc(td, &fp, &fd, 0)) != 0)
          return error;
        /* An extra reference on `fp' has been held for us by falloc(). */
 

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c        Fri Apr  1 13:23:53 2011        
(r220244)
+++ head/sys/kern/kern_descrip.c        Fri Apr  1 13:28:34 2011        
(r220245)
@@ -1516,7 +1516,7 @@ fdavail(struct thread *td, int n)
  * release the FILEDESC lock.
  */
 int
-fallocf(struct thread *td, struct file **resultfp, int *resultfd, int flags)
+falloc(struct thread *td, struct file **resultfp, int *resultfd, int flags)
 {
        struct proc *p = td->td_proc;
        struct file *fp;
@@ -1569,13 +1569,6 @@ fallocf(struct thread *td, struct file *
        return (0);
 }
 
-int
-falloc(struct thread *td, struct file **resultfp, int *resultfd)
-{
-
-       return (fallocf(td, resultfp, resultfd, 0));
-}
-
 /*
  * Build a new filedesc structure from another.
  * Copy the current, root, and jail root vnode references.

Modified: head/sys/kern/kern_event.c
==============================================================================
--- head/sys/kern/kern_event.c  Fri Apr  1 13:23:53 2011        (r220244)
+++ head/sys/kern/kern_event.c  Fri Apr  1 13:28:34 2011        (r220245)
@@ -684,7 +684,7 @@ kqueue(struct thread *td, struct kqueue_
        int fd, error;
 
        fdp = td->td_proc->p_fd;
-       error = falloc(td, &fp, &fd);
+       error = falloc(td, &fp, &fd, 0);
        if (error)
                goto done2;
 

Modified: head/sys/kern/sys_pipe.c
==============================================================================
--- head/sys/kern/sys_pipe.c    Fri Apr  1 13:23:53 2011        (r220244)
+++ head/sys/kern/sys_pipe.c    Fri Apr  1 13:28:34 2011        (r220245)
@@ -348,7 +348,7 @@ kern_pipe(struct thread *td, int fildes[
        rpipe->pipe_state |= PIPE_DIRECTOK;
        wpipe->pipe_state |= PIPE_DIRECTOK;
 
-       error = falloc(td, &rf, &fd);
+       error = falloc(td, &rf, &fd, 0);
        if (error) {
                pipeclose(rpipe);
                pipeclose(wpipe);
@@ -364,7 +364,7 @@ kern_pipe(struct thread *td, int fildes[
         * side while we are blocked trying to allocate the write side.
         */
        finit(rf, FREAD | FWRITE, DTYPE_PIPE, rpipe, &pipeops);
-       error = falloc(td, &wf, &fd);
+       error = falloc(td, &wf, &fd, 0);
        if (error) {
                fdclose(fdp, rf, fildes[0], td);
                fdrop(rf, td);

Modified: head/sys/kern/tty_pts.c
==============================================================================
--- head/sys/kern/tty_pts.c     Fri Apr  1 13:23:53 2011        (r220244)
+++ head/sys/kern/tty_pts.c     Fri Apr  1 13:28:34 2011        (r220245)
@@ -805,7 +805,7 @@ posix_openpt(struct thread *td, struct p
        if (uap->flags & ~(O_RDWR|O_NOCTTY))
                return (EINVAL);
        
-       error = falloc(td, &fp, &fd);
+       error = falloc(td, &fp, &fd, 0);
        if (error)
                return (error);
 

Modified: head/sys/kern/uipc_mqueue.c
==============================================================================
--- head/sys/kern/uipc_mqueue.c Fri Apr  1 13:23:53 2011        (r220244)
+++ head/sys/kern/uipc_mqueue.c Fri Apr  1 13:28:34 2011        (r220245)
@@ -1974,7 +1974,7 @@ kern_kmq_open(struct thread *td, const c
        if (len < 2  || path[0] != '/' || index(path + 1, '/') != NULL)
                return (EINVAL);
 
-       error = falloc(td, &fp, &fd);
+       error = falloc(td, &fp, &fd, 0);
        if (error)
                return (error);
 

Modified: head/sys/kern/uipc_sem.c
==============================================================================
--- head/sys/kern/uipc_sem.c    Fri Apr  1 13:23:53 2011        (r220244)
+++ head/sys/kern/uipc_sem.c    Fri Apr  1 13:28:34 2011        (r220245)
@@ -422,7 +422,7 @@ ksem_create(struct thread *td, const cha
 
        fdp = td->td_proc->p_fd;
        mode = (mode & ~fdp->fd_cmask) & ACCESSPERMS;
-       error = falloc(td, &fp, &fd);
+       error = falloc(td, &fp, &fd, 0);
        if (error) {
                if (name == NULL)
                        error = ENOSPC;

Modified: head/sys/kern/uipc_shm.c
==============================================================================
--- head/sys/kern/uipc_shm.c    Fri Apr  1 13:23:53 2011        (r220244)
+++ head/sys/kern/uipc_shm.c    Fri Apr  1 13:28:34 2011        (r220245)
@@ -496,7 +496,7 @@ shm_open(struct thread *td, struct shm_o
        fdp = td->td_proc->p_fd;
        cmode = (uap->mode & ~fdp->fd_cmask) & ACCESSPERMS;
 
-       error = falloc(td, &fp, &fd);
+       error = falloc(td, &fp, &fd, 0);
        if (error)
                return (error);
 

Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c       Fri Apr  1 13:23:53 2011        
(r220244)
+++ head/sys/kern/uipc_syscalls.c       Fri Apr  1 13:28:34 2011        
(r220245)
@@ -176,7 +176,7 @@ socket(td, uap)
                return (error);
 #endif
        fdp = td->td_proc->p_fd;
-       error = falloc(td, &fp, &fd);
+       error = falloc(td, &fp, &fd, 0);
        if (error)
                return (error);
        /* An extra reference on `fp' has been held for us by falloc(). */
@@ -358,7 +358,7 @@ kern_accept(struct thread *td, int s, st
        if (error != 0)
                goto done;
 #endif
-       error = falloc(td, &nfp, &fd);
+       error = falloc(td, &nfp, &fd, 0);
        if (error)
                goto done;
        ACCEPT_LOCK();
@@ -606,12 +606,12 @@ kern_socketpair(struct thread *td, int d
        if (error)
                goto free1;
        /* On success extra reference to `fp1' and 'fp2' is set by falloc. */
-       error = falloc(td, &fp1, &fd);
+       error = falloc(td, &fp1, &fd, 0);
        if (error)
                goto free2;
        rsv[0] = fd;
        fp1->f_data = so1;      /* so1 already has ref count */
-       error = falloc(td, &fp2, &fd);
+       error = falloc(td, &fp2, &fd, 0);
        if (error)
                goto free3;
        fp2->f_data = so2;      /* so2 already has ref count */
@@ -2299,7 +2299,7 @@ sctp_peeloff(td, uap)
         * but that is ok.
         */
 
-       error = falloc(td, &nfp, &fd);
+       error = falloc(td, &nfp, &fd, 0);
        if (error)
                goto done;
        td->td_retval[0] = fd;

Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c        Fri Apr  1 13:23:53 2011        
(r220244)
+++ head/sys/kern/vfs_syscalls.c        Fri Apr  1 13:28:34 2011        
(r220245)
@@ -1069,7 +1069,7 @@ kern_openat(struct thread *td, int fd, c
        else
                flags = FFLAGS(flags);
 
-       error = fallocf(td, &nfp, &indx, flags);
+       error = falloc(td, &nfp, &indx, flags);
        if (error)
                return (error);
        /* An extra reference on `nfp' has been held for us by falloc(). */
@@ -4495,7 +4495,7 @@ fhopen(td, uap)
         * end of vn_open code
         */
 
-       if ((error = fallocf(td, &nfp, &indx, fmode)) != 0) {
+       if ((error = falloc(td, &nfp, &indx, fmode)) != 0) {
                if (fmode & FWRITE)
                        vp->v_writecount--;
                goto bad;

Modified: head/sys/opencrypto/cryptodev.c
==============================================================================
--- head/sys/opencrypto/cryptodev.c     Fri Apr  1 13:23:53 2011        
(r220244)
+++ head/sys/opencrypto/cryptodev.c     Fri Apr  1 13:28:34 2011        
(r220245)
@@ -1109,7 +1109,7 @@ cryptoioctl(struct cdev *dev, u_long cmd
                TAILQ_INIT(&fcr->csessions);
                fcr->sesn = 0;
 
-               error = falloc(td, &f, &fd);
+               error = falloc(td, &f, &fd, 0);
 
                if (error) {
                        free(fcr, M_XDATA);

Modified: head/sys/sys/filedesc.h
==============================================================================
--- head/sys/sys/filedesc.h     Fri Apr  1 13:23:53 2011        (r220244)
+++ head/sys/sys/filedesc.h     Fri Apr  1 13:28:34 2011        (r220245)
@@ -111,8 +111,7 @@ struct thread;
 int    closef(struct file *fp, struct thread *td);
 int    dupfdopen(struct thread *td, struct filedesc *fdp, int indx, int dfd,
            int mode, int error);
-int    falloc(struct thread *td, struct file **resultfp, int *resultfd);
-int    fallocf(struct thread *td, struct file **resultfp, int *resultfd,
+int    falloc(struct thread *td, struct file **resultfp, int *resultfd,
            int flags);
 int    fdalloc(struct thread *td, int minfd, int *result);
 int    fdavail(struct thread *td, int n);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to