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

From: Rusty Russell
Date: Mon Oct 22 2012 - 22:01:44 EST


sjur.brandeland@xxxxxxxxxxxxxx writes:
> From: Sjur BrÃndeland <sjur.brandeland@xxxxxxxxxxxxxx>
>
> 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 <sjur.brandeland@xxxxxxxxxxxxxx>

This looks sensible; a couple of extra blank lines inserted though.

Amit?

> @@ -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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/