All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	ltp-list@lists.sourceforge.net,
	ltp-coverage@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [RFC PATCH 4/6] seq_file: add function to write binary data
Date: Thu, 08 May 2008 09:42:03 +0200	[thread overview]
Message-ID: <4822AECB.4040401@de.ibm.com> (raw)
In-Reply-To: <20080507204533.GA8850@martell.zuzino.mipt.ru>

Alexey Dobriyan wrote:
> On Thu, May 08, 2008 at 12:17:57AM +0400, Alexey Dobriyan wrote:
>> > > +		memcpy(m->buf + m->count, s, len);
>> > > +		m->count += len;
>> > > +		return 0;
>> > > +	}
>> > > +	m->count = m->size;
>> > > +	return -1;
>> > > +}
>> > > +EXPORT_SYMBOL(seq_write);
>> 
>> I'd call function seq_memcpy() though.
> 
> Or even seq_blob().

Hm, in my opinion seq_write() would fit more into the already existing
naming scheme of seq_file interface functions. The beauty of the idea
behind seq_file is that a user can just pretend to write to the buffer
that is read by a userspace application without having to worry about
full buffers, partial reads or seeks. In this context, the read becomes
a write and function names such as seq_printf(), seq_putc(), seq_puts()
or the suggested seq_write() seem to best fit this idea.


Regards,
  Peter

      reply	other threads:[~2008-05-08  7:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-05 15:24 [RFC PATCH 4/6] seq_file: add function to write binary data Peter Oberparleiter
2008-05-06  4:36 ` Andrew Morton
2008-05-06 18:37   ` Peter Oberparleiter
2008-05-07 20:17   ` Alexey Dobriyan
2008-05-07 20:45     ` Alexey Dobriyan
2008-05-08  7:42       ` Peter Oberparleiter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4822AECB.4040401@de.ibm.com \
    --to=peter.oberparleiter@de.ibm.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ltp-coverage@lists.sourceforge.net \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.