diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/seq_file.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/seq_file.c b/fs/seq_file.c index 3f54dbd6c49b..5d54205e486b 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c | |||
@@ -443,6 +443,20 @@ int seq_dentry(struct seq_file *m, struct dentry *dentry, char *esc) | |||
443 | return -1; | 443 | return -1; |
444 | } | 444 | } |
445 | 445 | ||
446 | int seq_bitmap(struct seq_file *m, unsigned long *bits, unsigned int nr_bits) | ||
447 | { | ||
448 | size_t len = bitmap_scnprintf_len(nr_bits); | ||
449 | |||
450 | if (m->count + len < m->size) { | ||
451 | bitmap_scnprintf(m->buf + m->count, m->size - m->count, | ||
452 | bits, nr_bits); | ||
453 | m->count += len; | ||
454 | return 0; | ||
455 | } | ||
456 | m->count = m->size; | ||
457 | return -1; | ||
458 | } | ||
459 | |||
446 | static void *single_start(struct seq_file *p, loff_t *pos) | 460 | static void *single_start(struct seq_file *p, loff_t *pos) |
447 | { | 461 | { |
448 | return NULL + (*pos == 0); | 462 | return NULL + (*pos == 0); |