git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6
[pandora-kernel.git]
/
kernel
/
relay.c
diff --git
a/kernel/relay.c
b/kernel/relay.c
index
3d97f28
..
c7cf397
100644
(file)
--- a/
kernel/relay.c
+++ b/
kernel/relay.c
@@
-539,7
+539,7
@@
static int __cpuinit relay_hotcpu_callback(struct notifier_block *nb,
"relay_hotcpu_callback: cpu %d buffer "
"creation failed\n", hotcpu);
mutex_unlock(&relay_channels_mutex);
"relay_hotcpu_callback: cpu %d buffer "
"creation failed\n", hotcpu);
mutex_unlock(&relay_channels_mutex);
- return
NOTIFY_BAD
;
+ return
notifier_from_errno(-ENOMEM)
;
}
}
mutex_unlock(&relay_channels_mutex);
}
}
mutex_unlock(&relay_channels_mutex);
@@
-1231,8
+1231,8
@@
static ssize_t subbuf_splice_actor(struct file *in,
size_t read_subbuf = read_start / subbuf_size;
size_t padding = rbuf->padding[read_subbuf];
size_t nonpad_end = read_subbuf * subbuf_size + subbuf_size - padding;
size_t read_subbuf = read_start / subbuf_size;
size_t padding = rbuf->padding[read_subbuf];
size_t nonpad_end = read_subbuf * subbuf_size + subbuf_size - padding;
- struct page *pages[PIPE_BUFFERS];
- struct partial_page partial[PIPE_BUFFERS];
+ struct page *pages[PIPE_
DEF_
BUFFERS];
+ struct partial_page partial[PIPE_
DEF_
BUFFERS];
struct splice_pipe_desc spd = {
.pages = pages,
.nr_pages = 0,
struct splice_pipe_desc spd = {
.pages = pages,
.nr_pages = 0,
@@
-1245,6
+1245,8
@@
static ssize_t subbuf_splice_actor(struct file *in,
if (rbuf->subbufs_produced == rbuf->subbufs_consumed)
return 0;
if (rbuf->subbufs_produced == rbuf->subbufs_consumed)
return 0;
+ if (splice_grow_spd(pipe, &spd))
+ return -ENOMEM;
/*
* Adjust read len, if longer than what is available
/*
* Adjust read len, if longer than what is available
@@
-1255,7
+1257,7
@@
static ssize_t 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;
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
);
+ nr_pages = min_t(unsigned int, subbuf_pages,
pipe->buffers
);
for (total_len = 0; spd.nr_pages < nr_pages; spd.nr_pages++) {
unsigned int this_len, this_end, private;
for (total_len = 0; spd.nr_pages < nr_pages; spd.nr_pages++) {
unsigned int this_len, this_end, private;
@@
-1289,16
+1291,19
@@
static ssize_t subbuf_splice_actor(struct file *in,
}
}
}
}
+ ret = 0;
if (!spd.nr_pages)
if (!spd.nr_pages)
-
return 0
;
+
goto out
;
ret = *nonpad_ret = splice_to_pipe(pipe, &spd);
if (ret < 0 || ret < total_len)
ret = *nonpad_ret = splice_to_pipe(pipe, &spd);
if (ret < 0 || ret < total_len)
-
return re
t;
+
goto ou
t;
if (read_start + ret == nonpad_end)
ret += padding;
if (read_start + ret == nonpad_end)
ret += padding;
+out:
+ splice_shrink_spd(pipe, &spd);
return ret;
}
return ret;
}