History

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().

Alexey Dobriyan committed 18 years ago

Commit 50ac2d61 parent dd763464 files · +38 −0Browse files

Showing the changes to include/linux/bitmap.h (1 of 4 files). Show all

Unified · Split

include/linux/bitmap.h+1−0
@@ -110,6 +110,7 @@ extern int __bitmap_weight(const unsigned long *bitmap, int bits); · 109 unmodified lines
110110
111111 extern int bitmap_scnprintf(char *buf, unsigned int len,
112112 const unsigned long *src, int nbits);
113+extern int bitmap_scnprintf_len(unsigned int nr_bits);
113114 extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user,
114115 unsigned long *dst, int nbits);
115116 extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t