Re: [PATCH 1/3] perf tools: Add perf_data_file__write interface

From: Jiri Olsa
Date: Tue Nov 26 2013 - 05:17:51 EST


On Mon, Nov 25, 2013 at 04:29:09PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Fri, Nov 22, 2013 at 03:24:26PM +0100, Jiri Olsa escreveu:
> > }
> > +
> > +ssize_t perf_data_file__write(struct perf_data_file *file,
> > + void *buf, size_t size)
> > +{
> > + ssize_t total = size;
> > +
> > + while (size) {
> > + ssize_t ret = write(file->fd, buf, size);
> > +
> > + if (ret < 0) {
> > + pr_err("failed to write perf data, error: %m\n");
> > + return -1;
> > + }
> > +
> > + size -= ret;
> > + buf += ret;
> > + }
> > +
> > + return total;
>
> So this is the functional equivalent of "readn", so please move it to
> just after "readn" and make this just a simple wrapper.

ok, thanks

jirka
--
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/