X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=include%2Flinux%2Fseq_file.h;h=cf6a9daaaf6d670eda5ae59495649099c455dd5c;hb=1f33c41c03daece85a84b8dcea5733f3efe3e2b0;hp=52e0097f61f00108f0faec9b37c57c2f03e1fcb2;hpb=f114040e3ea6e07372334ade75d1ee0775c355e1;p=deliverable%2Flinux.git diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 52e0097f61f0..cf6a9daaaf6d 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -42,6 +42,21 @@ struct seq_operations { #define SEQ_SKIP 1 +/** + * 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. + */ +static inline bool 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