diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-03-25 19:17:23 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-03-27 23:49:44 +0300 |
commit | 7b7ed885aff2eede24d641c3b042ebcf7517a5c5 (patch) | |
tree | 97c9dd78b5eeaf2b43636b3a1b9618e3400b407d /net/core/datagram.h | |
parent | a986967eb8e991481d688b74266d817e5341916a (diff) | |
download | linux-7b7ed885aff2eede24d641c3b042ebcf7517a5c5.tar.xz |
net/core: Allow the compiler to verify declaration and definition consistency
Instead of declaring a function in a .c file, declare it in a header
file and include that header file from the source files that define
and that use the function. That allows the compiler to verify
consistency of declaration and definition. See also commit
52267790ef52 ("sock: add MSG_ZEROCOPY") # v4.14.
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/datagram.h')
-rw-r--r-- | net/core/datagram.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/net/core/datagram.h b/net/core/datagram.h new file mode 100644 index 000000000000..bcfb75bfa3b2 --- /dev/null +++ b/net/core/datagram.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef _NET_CORE_DATAGRAM_H_ +#define _NET_CORE_DATAGRAM_H_ + +#include <linux/types.h> + +struct sock; +struct sk_buff; +struct iov_iter; + +int __zerocopy_sg_from_iter(struct sock *sk, struct sk_buff *skb, + struct iov_iter *from, size_t length); + +#endif /* _NET_CORE_DATAGRAM_H_ */ |