Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24.6 /kernel/relay.c

Filename:/kernel/relay.c
Lines Added:4
Lines Deleted:2
Also changed in: (Previous) 2.6.24.5  2.6.24.4  2.6.24.4-rc3  2.6.24.4-rc2  2.6.24.4-rc1  2.6.24.2 
(Following) 2.6.24.7  2.6.25-git19  2.6.25-git20  2.6.25.16-rc1  2.6.25.16  2.6.25.17 

Location
[  2.6.24.6
  [  kernel
     o  relay.c

Patch

diff --git a/kernel/relay.c b/kernel/relay.c
index 61134eb..889102a 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -92,6 +92,7 @@ static int relay_mmap_buf(struct rchan_buf *buf, struct vm_area_struct *vma)
       return -EINVAL;
 
    vma->vm_ops = &relay_file_mmap_ops;
+   vma->vm_flags |= VM_DONTEXPAND;
    vma->vm_private_data = buf;
    buf->chan->cb->buf_mapped(buf, filp);
 
@@ -1071,7 +1072,7 @@ static int subbuf_splice_actor(struct file *in,
                 unsigned int flags,
                 int *nonpad_ret)
 {
-   unsigned int pidx, poff, total_len, subbuf_pages, ret;
+   unsigned int pidx, poff, total_len, subbuf_pages, nr_pages, ret;
    struct rchan_buf *rbuf = in->private_data;
    unsigned int subbuf_size = rbuf->chan->subbuf_size;
    uint64_t pos = (uint64_t) *ppos;
@@ -1102,8 +1103,9 @@ static int subbuf_splice_actor(struct file *in,
    subbuf_pages = rbuf->chan->alloc_size >> PAGE_SHIFT;
    pidx = (read_start / PAGE_SIZE) % subbuf_pages;
    poff = read_start & ~PAGE_MASK;
+   nr_pages = min_t(unsigned int, subbuf_pages, PIPE_BUFFERS);
 
-   for (total_len = 0; spd.nr_pages < subbuf_pages; spd.nr_pages++) {
+   for (total_len = 0; spd.nr_pages < nr_pages; spd.nr_pages++) {
       unsigned int this_len, this_end, private;
       unsigned int cur_pos = read_start + total_len;
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.