Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/src/linux_seq_file.c
Context not available. | |||||
struct seq_file *m = f->private_data; | struct seq_file *m = f->private_data; | ||||
void *p; | void *p; | ||||
int rc; | int rc; | ||||
off_t pos = 0; | |||||
p = m->op->start(m, &pos); | p = m->op->start(m, ppos); | ||||
markj: Is this a bug fix? | |||||
Done Inline ActionsYes. jfree: Yes. | |||||
rc = m->op->show(m, p); | rc = m->op->show(m, p); | ||||
if (rc) | if (rc) | ||||
return (rc); | return (rc); | ||||
Context not available. | |||||
{ | { | ||||
struct seq_file *p; | struct seq_file *p; | ||||
if (f->private_data != NULL) | |||||
log(LOG_WARNING, "%s private_data not NULL", __func__); | |||||
if ((p = malloc(sizeof(*p), M_LSEQ, M_NOWAIT|M_ZERO)) == NULL) | if ((p = malloc(sizeof(*p), M_LSEQ, M_NOWAIT|M_ZERO)) == NULL) | ||||
return (-ENOMEM); | return (-ENOMEM); | ||||
f->private_data = p; | /* | ||||
* This seq_file's ->buf is passed in through f->private_data. | |||||
* A clean seq_file implementation is needed to remove the | |||||
* FreeBSD sbuf dependency. | |||||
*/ | |||||
if (f->private_data != NULL) | |||||
p->buf = (struct sbuf *) f->private_data; | |||||
p->op = op; | p->op = op; | ||||
p->file = f; | p->file = f; | ||||
f->private_data = (void *) p; | |||||
return (0); | return (0); | ||||
} | } | ||||
Context not available. | |||||
free(__DECONST(void *, op), M_LSEQ); | free(__DECONST(void *, op), M_LSEQ); | ||||
return (rc); | return (rc); | ||||
} | } | ||||
void | |||||
seq_vprintf(struct seq_file *m, const char *fmt, va_list args) | |||||
{ | |||||
sbuf_vprintf(m->buf, fmt, args); | |||||
return; | |||||
} | |||||
void | |||||
seq_printf(struct seq_file *m, const char *fmt, ...) | |||||
{ | |||||
va_list args; | |||||
va_start(args, fmt); | |||||
seq_vprintf(m, fmt, args); | |||||
va_end(args); | |||||
return; | |||||
} | |||||
Context not available. |
Is this a bug fix?