9 #include <linux/export.h>
11 #include <linux/slab.h>
14 #include <asm/uaccess.h>
23 static bool seq_overflow(
struct seq_file *
m)
28 static void seq_set_overflow(
struct seq_file *
m)
61 p->user_ns = file->
f_cred->user_ns;
108 error = m->
op->show(m, p);
117 if (pos + m->
count > offset) {
178 while ((err = traverse(m, *ppos)) == -
EAGAIN)
216 p = m->
op->start(m, &pos);
221 err = m->
op->show(m, p);
227 p = m->
op->next(m, p, &pos);
241 p = m->
op->start(m, &pos);
248 while (m->
count < size) {
251 p = m->
op->next(m, p, &next);
252 if (!p || IS_ERR(p)) {
256 err = m->
op->show(m, p);
257 if (seq_overflow(m) || err) {
312 offset += file->
f_pos;
318 while ((retval=traverse(m, offset)) == -
EAGAIN)
372 for (p = m->
buf + m->
count; (c = *s) !=
'\0' && p < end; s++) {
379 *p++ =
'0' + ((c & 0300) >> 6);
380 *p++ =
'0' + ((c & 070) >> 3);
381 *p++ =
'0' + (c & 07);
438 }
else if (!
strchr(esc, c)) {
440 }
else if (s + 4 > p) {
444 *s++ =
'0' + ((c & 0300) >> 6);
445 *s++ =
'0' + ((c & 070) >> 3);
446 *s++ =
'0' + (c & 07);
465 size_t size = seq_get_buf(m, &buf);
469 char *p =
d_path(path, buf, size);
486 const struct path *root,
const char *esc)
489 size_t size = seq_get_buf(m, &buf);
495 p =
__d_path(path, root, buf, size);
518 size_t size = seq_get_buf(m, &buf);
535 unsigned int nr_bits)
551 unsigned int nr_bits)
566 static void *single_start(
struct seq_file *p, loff_t *pos)
568 return NULL + (*pos == 0);
571 static void *single_next(
struct seq_file *p,
void *
v, loff_t *pos)
577 static void single_stop(
struct seq_file *p,
void *
v)
588 op->
start = single_start;
589 op->
next = single_next;
590 op->
stop = single_stop;
685 unsigned long long num)
744 seq_set_overflow(seq);
776 return lh == head ?
NULL : lh;
852 __hlist_for_each_rcu(node, head)