]> err.no Git - linux-2.6/commit
seq_file: add seq_cpumask(), seq_nodemask()
authorAlexey Dobriyan <adobriyan@gmail.com>
Tue, 12 Aug 2008 22:09:02 +0000 (15:09 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Aug 2008 23:07:30 +0000 (16:07 -0700)
commit50ac2d694f2dd1658341cf97bcf2ffb836d772cb
treec4466ecb7c5211ee9423380783f00027411d5d5a
parentdd763460eb628b57814251a15a39f8d75c044d76
seq_file: add seq_cpumask(), seq_nodemask()

Short enough reads from /proc/irq/*/smp_affinity return -EINVAL for no
good reason.

This became noticed with NR_CPUS=4096 patches, when length of printed
representation of cpumask becase 1152, but cat(1) continued to read with
1024-byte chunks.  bitmap_scnprintf() in good faith fills buffer, returns
1023, check returns -EINVAL.

Fix it by switching to seq_file, so handler will just fill buffer and
doesn't care about offsets, length, filling EOF and all this crap.

For that add seq_bitmap(), and wrappers around it -- seq_cpumask() and
seq_nodemask().

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Reviewed-by: Paul Jackson <pj@sgi.com>
Cc: Mike Travis <travis@sgi.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/seq_file.c
include/linux/bitmap.h
include/linux/seq_file.h
lib/bitmap.c