new helper: single_open_size()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 31 Mar 2013 17:43:23 +0000 (13:43 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 9 Apr 2013 18:13:29 +0000 (14:13 -0400)
commit2043f495c7c1a06f7748b5bcd17656d93c95e1a6
treef3d0368632a1fda88bb385ddfc01600fe450e74f
parent70ef457dc92bdd03c0c8d640fce45909166983a1
new helper: single_open_size()

Same as single_open(), but preallocates the buffer of given size.
Doesn't make any sense for sizes up to PAGE_SIZE and doesn't make
sense if output of show() exceeds PAGE_SIZE only rarely - seq_read()
will take care of growing the buffer and redoing show().  If you
_know_ that it will be large, it might make more sense to look into
saner iterator, rather than go with single-shot one.  If that's
impossible, single_open_size() might be for you.

Again, don't use that without a good reason; occasionally that's really
the best way to go, but very often there are better solutions.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/seq_file.c
include/linux/seq_file.h