diff options
Diffstat (limited to 'kernel/relay.c')
-rw-r--r-- | kernel/relay.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/kernel/relay.c b/kernel/relay.c index 01ab081ac53a..eef0d113b79e 100644 --- a/kernel/relay.c +++ b/kernel/relay.c | |||
@@ -588,7 +588,7 @@ struct rchan *relay_open(const char *base_filename, | |||
588 | chan->version = RELAYFS_CHANNEL_VERSION; | 588 | chan->version = RELAYFS_CHANNEL_VERSION; |
589 | chan->n_subbufs = n_subbufs; | 589 | chan->n_subbufs = n_subbufs; |
590 | chan->subbuf_size = subbuf_size; | 590 | chan->subbuf_size = subbuf_size; |
591 | chan->alloc_size = FIX_SIZE(subbuf_size * n_subbufs); | 591 | chan->alloc_size = PAGE_ALIGN(subbuf_size * n_subbufs); |
592 | chan->parent = parent; | 592 | chan->parent = parent; |
593 | chan->private_data = private_data; | 593 | chan->private_data = private_data; |
594 | if (base_filename) { | 594 | if (base_filename) { |
@@ -1099,8 +1099,7 @@ static size_t relay_file_read_end_pos(struct rchan_buf *buf, | |||
1099 | static int subbuf_read_actor(size_t read_start, | 1099 | static int subbuf_read_actor(size_t read_start, |
1100 | struct rchan_buf *buf, | 1100 | struct rchan_buf *buf, |
1101 | size_t avail, | 1101 | size_t avail, |
1102 | read_descriptor_t *desc, | 1102 | read_descriptor_t *desc) |
1103 | read_actor_t actor) | ||
1104 | { | 1103 | { |
1105 | void *from; | 1104 | void *from; |
1106 | int ret = 0; | 1105 | int ret = 0; |
@@ -1121,15 +1120,13 @@ static int subbuf_read_actor(size_t read_start, | |||
1121 | typedef int (*subbuf_actor_t) (size_t read_start, | 1120 | typedef int (*subbuf_actor_t) (size_t read_start, |
1122 | struct rchan_buf *buf, | 1121 | struct rchan_buf *buf, |
1123 | size_t avail, | 1122 | size_t avail, |
1124 | read_descriptor_t *desc, | 1123 | read_descriptor_t *desc); |
1125 | read_actor_t actor); | ||
1126 | 1124 | ||
1127 | /* | 1125 | /* |
1128 | * relay_file_read_subbufs - read count bytes, bridging subbuf boundaries | 1126 | * relay_file_read_subbufs - read count bytes, bridging subbuf boundaries |
1129 | */ | 1127 | */ |
1130 | static ssize_t relay_file_read_subbufs(struct file *filp, loff_t *ppos, | 1128 | static ssize_t relay_file_read_subbufs(struct file *filp, loff_t *ppos, |
1131 | subbuf_actor_t subbuf_actor, | 1129 | subbuf_actor_t subbuf_actor, |
1132 | read_actor_t actor, | ||
1133 | read_descriptor_t *desc) | 1130 | read_descriptor_t *desc) |
1134 | { | 1131 | { |
1135 | struct rchan_buf *buf = filp->private_data; | 1132 | struct rchan_buf *buf = filp->private_data; |
@@ -1150,7 +1147,7 @@ static ssize_t relay_file_read_subbufs(struct file *filp, loff_t *ppos, | |||
1150 | break; | 1147 | break; |
1151 | 1148 | ||
1152 | avail = min(desc->count, avail); | 1149 | avail = min(desc->count, avail); |
1153 | ret = subbuf_actor(read_start, buf, avail, desc, actor); | 1150 | ret = subbuf_actor(read_start, buf, avail, desc); |
1154 | if (desc->error < 0) | 1151 | if (desc->error < 0) |
1155 | break; | 1152 | break; |
1156 | 1153 | ||
@@ -1174,8 +1171,7 @@ static ssize_t relay_file_read(struct file *filp, | |||
1174 | desc.count = count; | 1171 | desc.count = count; |
1175 | desc.arg.buf = buffer; | 1172 | desc.arg.buf = buffer; |
1176 | desc.error = 0; | 1173 | desc.error = 0; |
1177 | return relay_file_read_subbufs(filp, ppos, subbuf_read_actor, | 1174 | return relay_file_read_subbufs(filp, ppos, subbuf_read_actor, &desc); |
1178 | NULL, &desc); | ||
1179 | } | 1175 | } |
1180 | 1176 | ||
1181 | static void relay_consume_bytes(struct rchan_buf *rbuf, int bytes_consumed) | 1177 | static void relay_consume_bytes(struct rchan_buf *rbuf, int bytes_consumed) |