Thread (9 messages) 9 messages, 3 authors, 2012-10-23

Re: [PATCHv7 3/4] virtio_console: Merge struct buffer_token into struct port_buffer

flat view

From: Rusty Russell <hidden>
Date: 2012-10-23 02:01:56
Also in: lkml

sjur.brandeland@stericsson.com writes:
From: Sjur Brændeland <redacted>

Refactoring the splice functionality by unifying the approach for
sending scatter-lists and regular buffers. This simplifies
buffer handling and reduces code size. Splice will now allocate
a port_buffer and send_buf() and free_buf() can always be used
for any buffer.

Signed-off-by: Sjur Brændeland <redacted>
This looks sensible; a couple of extra blank lines inserted though.

Amit?
quoted hunk ↗ jump to hunk
@@ -1033,6 +1008,8 @@ static const struct file_operations port_fops = {
 static int put_chars(u32 vtermno, const char *buf, int count)
 {
 	struct port *port;
+	struct scatterlist sg[1];
+
 
 	if (unlikely(early_put_chars))
 		return early_put_chars(vtermno, buf, count);
@@ -1041,7 +1018,9 @@ static int put_chars(u32 vtermno, const char *buf, int count)
 	if (!port)
 		return -EPIPE;
 
-	return send_buf(port, (void *)buf, count, false);
+	sg_init_one(sg, buf, count);
+	return __send_to_port(port, sg, 1, count, (void *)buf, false);
+
 }
 
 /*
Cheers,
Rusty.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help