]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - include/linux/seq_file.h
Merge tag 'ftracetest-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[mirror_ubuntu-zesty-kernel.git] / include / linux / seq_file.h
index 52e0097f61f00108f0faec9b37c57c2f03e1fcb2..cf6a9daaaf6d670eda5ae59495649099c455dd5c 100644 (file)
@@ -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