aboutsummaryrefslogtreecommitdiffstats
path: root/fs/seq_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/seq_file.c')
-rw-r--r--fs/seq_file.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/fs/seq_file.c b/fs/seq_file.c
index bd20f7f5a933..eba2eabcd2b8 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -452,17 +452,34 @@ int seq_dentry(struct seq_file *m, struct dentry *dentry, char *esc)
452 452
453int seq_bitmap(struct seq_file *m, unsigned long *bits, unsigned int nr_bits) 453int seq_bitmap(struct seq_file *m, unsigned long *bits, unsigned int nr_bits)
454{ 454{
455 size_t len = bitmap_scnprintf_len(nr_bits); 455 if (m->count < m->size) {
456 int len = bitmap_scnprintf(m->buf + m->count,
457 m->size - m->count, bits, nr_bits);
458 if (m->count + len < m->size) {
459 m->count += len;
460 return 0;
461 }
462 }
463 m->count = m->size;
464 return -1;
465}
466EXPORT_SYMBOL(seq_bitmap);
456 467
457 if (m->count + len < m->size) { 468int seq_bitmap_list(struct seq_file *m, unsigned long *bits,
458 bitmap_scnprintf(m->buf + m->count, m->size - m->count, 469 unsigned int nr_bits)
459 bits, nr_bits); 470{
460 m->count += len; 471 if (m->count < m->size) {
461 return 0; 472 int len = bitmap_scnlistprintf(m->buf + m->count,
473 m->size - m->count, bits, nr_bits);
474 if (m->count + len < m->size) {
475 m->count += len;
476 return 0;
477 }
462 } 478 }
463 m->count = m->size; 479 m->count = m->size;
464 return -1; 480 return -1;
465} 481}
482EXPORT_SYMBOL(seq_bitmap_list);
466 483
467static void *single_start(struct seq_file *p, loff_t *pos) 484static void *single_start(struct seq_file *p, loff_t *pos)
468{ 485{