[MINOR] introduce structures required to support Linux kernel splicing
When CONFIG_HAP_LINUX_SPLICE is defined, the buffer structure will be
slightly enlarged to support information needed for kernel splicing
on Linux.
A first attempt consisted in putting this information into the stream
interface, but in the long term, it appeared really awkward. This
version puts the information into the buffer. The platform-dependant
part is conditionally added and will only enlarge the buffers when
compiled in.
One new flag has also been added to the buffers: BF_KERN_SPLICING.
It indicates that the application considers it is appropriate to
use splicing to forward remaining data.
diff --git a/include/proto/buffers.h b/include/proto/buffers.h
index 1cd6650..9ebc6ff 100644
--- a/include/proto/buffers.h
+++ b/include/proto/buffers.h
@@ -54,6 +54,9 @@
buf->flags = BF_EMPTY;
buf->r = buf->lr = buf->w = buf->data;
buf->max_len = BUFSIZE;
+#if defined(CONFIG_HAP_LINUX_SPLICE)
+ buf->splice.prod = buf->splice.cons = -1; /* closed */
+#endif
}
/* returns 1 if the buffer is empty, 0 otherwise */