diff options
Diffstat (limited to 'fs/seq_file.c')
-rw-r--r-- | fs/seq_file.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/fs/seq_file.c b/fs/seq_file.c index 3857b720cb1b..353948ba1c5b 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c | |||
@@ -16,17 +16,6 @@ | |||
16 | #include <asm/uaccess.h> | 16 | #include <asm/uaccess.h> |
17 | #include <asm/page.h> | 17 | #include <asm/page.h> |
18 | 18 | ||
19 | |||
20 | /* | ||
21 | * seq_files have a buffer which can may overflow. When this happens a larger | ||
22 | * buffer is reallocated and all the data will be printed again. | ||
23 | * The overflow state is true when m->count == m->size. | ||
24 | */ | ||
25 | static bool seq_overflow(struct seq_file *m) | ||
26 | { | ||
27 | return m->count == m->size; | ||
28 | } | ||
29 | |||
30 | static void seq_set_overflow(struct seq_file *m) | 19 | static void seq_set_overflow(struct seq_file *m) |
31 | { | 20 | { |
32 | m->count = m->size; | 21 | m->count = m->size; |
@@ -124,7 +113,7 @@ static int traverse(struct seq_file *m, loff_t offset) | |||
124 | error = 0; | 113 | error = 0; |
125 | m->count = 0; | 114 | m->count = 0; |
126 | } | 115 | } |
127 | if (seq_overflow(m)) | 116 | if (seq_has_overflowed(m)) |
128 | goto Eoverflow; | 117 | goto Eoverflow; |
129 | if (pos + m->count > offset) { | 118 | if (pos + m->count > offset) { |
130 | m->from = offset - pos; | 119 | m->from = offset - pos; |
@@ -267,7 +256,7 @@ Fill: | |||
267 | break; | 256 | break; |
268 | } | 257 | } |
269 | err = m->op->show(m, p); | 258 | err = m->op->show(m, p); |
270 | if (seq_overflow(m) || err) { | 259 | if (seq_has_overflowed(m) || err) { |
271 | m->count = offs; | 260 | m->count = offs; |
272 | if (likely(err <= 0)) | 261 | if (likely(err <= 0)) |
273 | break; | 262 | break; |