/** * seq_has_overflowed - check if the buffer has overflowed * @m: the seq_file handle * * seq_files have a buffer which may overflow. When this happens a larger * buffer is reallocated and all the data will be printed again. * The overflow state is true when m->count == m->size. * * Returns true if the buffer received more than it can hold.
*/ staticinlinebool seq_has_overflowed(struct seq_file *m)
{ return m->count == m->size;
}
/** * seq_get_buf - get buffer to write arbitrary data to * @m: the seq_file handle * @bufp: the beginning of the buffer is stored here * * Return the number of bytes available in the buffer, or zero if * there's no space.
*/ staticinline size_t seq_get_buf(struct seq_file *m, char **bufp)
{
BUG_ON(m->count > m->size); if (m->count < m->size)
*bufp = m->buf + m->count; else
*bufp = NULL;
return m->size - m->count;
}
/** * seq_commit - commit data to the buffer * @m: the seq_file handle * @num: the number of bytes to commit * * Commit @num bytes of data written to a buffer previously acquired * by seq_buf_get. To signal an error condition, or that the data * didn't fit in the available space, pass a negative @num value.
*/ staticinlinevoid seq_commit(struct seq_file *m, int num)
{ if (num < 0) {
m->count = m->size;
} else {
BUG_ON(m->count + num > m->size);
m->count += num;
}
}
/** * seq_setwidth - set padding width * @m: the seq_file handle * @size: the max number of bytes to pad. * * Call seq_setwidth() for setting max width, then call seq_printf() etc. and * finally call seq_pad() to pad the remaining bytes.
*/ staticinlinevoid seq_setwidth(struct seq_file *m, size_t size)
{
m->pad_until = m->count + size;
} void seq_pad(struct seq_file *m, char c);
/** * seq_escape - print string into buffer, escaping some characters * @m: target buffer * @s: NULL-terminated string * @esc: set of characters that need escaping * * Puts string into buffer, replacing each occurrence of character from * @esc with usual octal escape. * * Use seq_has_overflowed() to check for errors.
*/ staticinlinevoid seq_escape(struct seq_file *m, constchar *s, constchar *esc)
{
seq_escape_str(m, s, ESCAPE_OCTAL, esc);
}
void seq_hex_dump(struct seq_file *m, constchar *prefix_str, int prefix_type, int rowsize, int groupsize, constvoid *buf, size_t len, bool ascii);
int seq_path(struct seq_file *, conststruct path *, constchar *); int seq_file_path(struct seq_file *, struct file *, constchar *); int seq_dentry(struct seq_file *, struct dentry *, constchar *); int seq_path_root(struct seq_file *m, conststruct path *path, conststruct path *root, constchar *esc);
void *single_start(struct seq_file *, loff_t *); int single_open(struct file *, int (*)(struct seq_file *, void *), void *); int single_open_size(struct file *, int (*)(struct seq_file *, void *), void *, size_t); int single_release(struct inode *, struct file *); void *__seq_open_private(struct file *, conststruct seq_operations *, int); int seq_open_private(struct file *, conststruct seq_operations *, int); int seq_release_private(struct inode *, struct file *);
/** * seq_show_options - display mount options with appropriate escapes. * @m: the seq_file handle * @name: the mount option name * @value: the mount option name's value, can be NULL
*/ staticinlinevoid seq_show_option(struct seq_file *m, constchar *name, constchar *value)
{
seq_putc(m, ',');
seq_escape(m, name, ",= \t\n\\"); if (value) {
seq_putc(m, '=');
seq_escape(m, value, ", \t\n\\");
}
}
/** * seq_show_option_n - display mount options with appropriate escapes * where @value must be a specific length (i.e. * not NUL-terminated). * @m: the seq_file handle * @name: the mount option name * @value: the mount option name's value, cannot be NULL * @length: the exact length of @value to display, must be constant expression * * This is a macro since this uses "length" to define the size of the * stack buffer.
*/ #define seq_show_option_n(m, name, value, length) { \ char val_buf[length + 1]; \
memcpy(val_buf, value, length); \
val_buf[length] = '\0'; \
seq_show_option(m, name, val_buf); \
}
#define SEQ_START_TOKEN ((void *)1) /* * Helpers for iteration over list_head-s in seq_files
*/
/* Helpers for iterating over per-cpu hlist_head-s in seq_files */ externstruct hlist_node *seq_hlist_start_percpu(struct hlist_head __percpu *head, int *cpu, loff_t pos);
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.14Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.