mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-04 15:40:44 +00:00
- The vm_object pointer in pipe_buffer is unused. Remove it.
- Check for successful initialization of pipe_zone in pipeinit() rather than every call to pipe(2).
This commit is contained in:
parent
4250a68e2d
commit
77685ea594
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=118880
|
@ -213,8 +213,10 @@ SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_ANY, pipeinit, NULL);
|
|||
static void
|
||||
pipeinit(void *dummy __unused)
|
||||
{
|
||||
|
||||
pipe_zone = uma_zcreate("PIPE", sizeof(struct pipe), NULL,
|
||||
NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
|
||||
KASSERT(pipe_zone != NULL, ("pipe_zone not initialized"));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -235,8 +237,6 @@ pipe(td, uap)
|
|||
struct mtx *pmtx;
|
||||
int fd, error;
|
||||
|
||||
KASSERT(pipe_zone != NULL, ("pipe_zone not initialized"));
|
||||
|
||||
pmtx = malloc(sizeof(*pmtx), M_TEMP, M_WAITOK | M_ZERO);
|
||||
|
||||
rpipe = wpipe = NULL;
|
||||
|
@ -361,7 +361,6 @@ pipespace(cpipe, size)
|
|||
|
||||
/* free old resources if we're resizing */
|
||||
pipe_free_kmem(cpipe);
|
||||
cpipe->pipe_buffer.object = object;
|
||||
cpipe->pipe_buffer.buffer = buffer;
|
||||
cpipe->pipe_buffer.size = size;
|
||||
cpipe->pipe_buffer.in = 0;
|
||||
|
@ -388,8 +387,6 @@ pipe_create(cpipep)
|
|||
|
||||
cpipe = *cpipep;
|
||||
|
||||
/* so pipespace()->pipe_free_kmem() doesn't follow junk pointer */
|
||||
cpipe->pipe_buffer.object = NULL;
|
||||
/*
|
||||
* protect so pipeclose() doesn't follow a junk pointer
|
||||
* if pipespace() fails.
|
||||
|
|
|
@ -74,7 +74,6 @@ struct pipebuf {
|
|||
u_int out; /* out pointer */
|
||||
u_int size; /* size of buffer */
|
||||
caddr_t buffer; /* kva of buffer */
|
||||
struct vm_object *object; /* VM object containing buffer */
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue