summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/kern/sys_pipe.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-12-20 11:12:40 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-12-20 13:36:34 +0100
commit2b2563da953978f63e3e707f758fd600dcd19a32 (patch)
treea207b096c10788192b56025e8187f14d1b5a978d /freebsd/sys/kern/sys_pipe.c
parentfreebsd/if_cpsw: Port. (diff)
downloadrtems-libbsd-2b2563da953978f63e3e707f758fd600dcd19a32.tar.bz2
Update to FreeBSD head 2018-12-20
Git mirror commit 19a6ceb89dbacf74697d493e48c388767126d418. It includes an update of wpa_supplicant to version 2.7. It includes an update of the OpenSSL baseline to version 1.1.1a. Update #3472.
Diffstat (limited to 'freebsd/sys/kern/sys_pipe.c')
-rwxr-xr-xfreebsd/sys/kern/sys_pipe.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/freebsd/sys/kern/sys_pipe.c b/freebsd/sys/kern/sys_pipe.c
index b6616271..050d63a4 100755
--- a/freebsd/sys/kern/sys_pipe.c
+++ b/freebsd/sys/kern/sys_pipe.c
@@ -294,7 +294,7 @@ static int pipe_zone_init(void *mem, int size, int flags);
static void pipe_zone_fini(void *mem, int size);
static uma_zone_t pipe_zone;
-static struct unrhdr *pipeino_unr;
+static struct unrhdr64 pipeino_unr;
static dev_t pipedev_ino;
SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_ANY, pipeinit, NULL);
@@ -307,8 +307,7 @@ pipeinit(void *dummy __unused)
pipe_zone_ctor, NULL, pipe_zone_init, pipe_zone_fini,
UMA_ALIGN_PTR, 0);
KASSERT(pipe_zone != NULL, ("pipe_zone not initialized"));
- pipeino_unr = new_unrhdr(1, INT32_MAX, NULL);
- KASSERT(pipeino_unr != NULL, ("pipe fake inodes not initialized"));
+ new_unrhdr64(&pipeino_unr, 1);
pipedev_ino = devfs_alloc_cdp_inode();
KASSERT(pipedev_ino > 0, ("pipe dev inode not initialized"));
}
@@ -444,8 +443,6 @@ pipe_dtor(struct pipe *dpipe)
funsetown(&peer->pipe_sigio);
pipeclose(peer);
}
- if (ino != 0 && ino != (ino_t)-1)
- free_unr(pipeino_unr, ino);
}
/*
@@ -730,7 +727,7 @@ pipe_create(struct pipe *pipe, int backing)
(void)pipespace_new(pipe, PIPE_SIZE);
}
- pipe->pipe_ino = -1;
+ pipe->pipe_ino = alloc_unr64(&pipeino_unr);
}
/* ARGSUSED */
@@ -1762,7 +1759,6 @@ static int
pipe_stat(struct pipe *pipe, struct stat *ub)
{
#endif /* __rtems__ */
- int new_unr;
#ifdef MAC
int error;
#endif
@@ -1789,23 +1785,6 @@ pipe_stat(struct pipe *pipe, struct stat *ub)
#endif /* __rtems__ */
}
- /*
- * Lazily allocate an inode number for the pipe. Most pipe
- * users do not call fstat(2) on the pipe, which means that
- * postponing the inode allocation until it is must be
- * returned to userland is useful. If alloc_unr failed,
- * assign st_ino zero instead of returning an error.
- * Special pipe_ino values:
- * -1 - not yet initialized;
- * 0 - alloc_unr failed, return 0 as st_ino forever.
- */
- if (pipe->pipe_ino == (ino_t)-1) {
- new_unr = alloc_unr(pipeino_unr);
- if (new_unr != -1)
- pipe->pipe_ino = new_unr;
- else
- pipe->pipe_ino = 0;
- }
PIPE_UNLOCK(pipe);
#ifndef __rtems__