Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151153890
D23993.id69328.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D23993.id69328.diff
View Options
Index: head/sys/kern/sys_pipe.c
===================================================================
--- head/sys/kern/sys_pipe.c
+++ head/sys/kern/sys_pipe.c
@@ -507,8 +507,8 @@
error = vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, size, 0,
VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0);
if (error != KERN_SUCCESS) {
- if ((cpipe->pipe_buffer.buffer == NULL) &&
- (size > SMALL_PIPE_SIZE)) {
+ if (cpipe->pipe_buffer.buffer == NULL &&
+ size > SMALL_PIPE_SIZE) {
size = SMALL_PIPE_SIZE;
pipefragretry++;
goto retry;
@@ -555,7 +555,7 @@
{
KASSERT(cpipe->pipe_state & PIPE_LOCKFL,
- ("Unlocked pipe passed to pipespace"));
+ ("Unlocked pipe passed to pipespace"));
return (pipespace_new(cpipe, size));
}
@@ -660,10 +660,10 @@
goto locked_error;
#endif
if (amountpipekva > (3 * maxpipekva) / 4) {
- if (!(rpipe->pipe_state & PIPE_DIRECTW) &&
- (rpipe->pipe_buffer.size > SMALL_PIPE_SIZE) &&
- (rpipe->pipe_buffer.cnt <= SMALL_PIPE_SIZE) &&
- (piperesizeallowed == 1)) {
+ if ((rpipe->pipe_state & PIPE_DIRECTW) == 0 &&
+ rpipe->pipe_buffer.size > SMALL_PIPE_SIZE &&
+ rpipe->pipe_buffer.cnt <= SMALL_PIPE_SIZE &&
+ piperesizeallowed == 1) {
PIPE_UNLOCK(rpipe);
pipespace(rpipe, SMALL_PIPE_SIZE);
PIPE_LOCK(rpipe);
@@ -1011,10 +1011,9 @@
pipe_write(struct file *fp, struct uio *uio, struct ucred *active_cred,
int flags, struct thread *td)
{
- int error = 0;
- int desiredsize;
- ssize_t orig_resid;
struct pipe *wpipe, *rpipe;
+ ssize_t orig_resid;
+ int desiredsize, error;
rpipe = fp->f_data;
wpipe = PIPE_PEER(rpipe);
@@ -1056,15 +1055,15 @@
}
/* Choose a smaller size if we're in a OOM situation */
- if ((amountpipekva > (3 * maxpipekva) / 4) &&
- (wpipe->pipe_buffer.size > SMALL_PIPE_SIZE) &&
- (wpipe->pipe_buffer.cnt <= SMALL_PIPE_SIZE) &&
- (piperesizeallowed == 1))
+ if (amountpipekva > (3 * maxpipekva) / 4 &&
+ wpipe->pipe_buffer.size > SMALL_PIPE_SIZE &&
+ wpipe->pipe_buffer.cnt <= SMALL_PIPE_SIZE &&
+ piperesizeallowed == 1)
desiredsize = SMALL_PIPE_SIZE;
/* Resize if the above determined that a new size was necessary */
- if ((desiredsize != wpipe->pipe_buffer.size) &&
- ((wpipe->pipe_state & PIPE_DIRECTW) == 0)) {
+ if (desiredsize != wpipe->pipe_buffer.size &&
+ (wpipe->pipe_state & PIPE_DIRECTW) == 0) {
PIPE_UNLOCK(wpipe);
pipespace(wpipe, desiredsize);
PIPE_LOCK(wpipe);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 11:24 AM (13 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31027913
Default Alt Text
D23993.id69328.diff (2 KB)
Attached To
Mode
D23993: Preallocate pipe buffers on pipe creation.
Attached
Detach File
Event Timeline
Log In to Comment