2 * Support routines for TCP zero copy transmit
4 * Created by Vladislav Bolkhovitin
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
11 #include <linux/skbuff.h>
13 net_get_page_callback_t net_get_page_callback __read_mostly;
14 EXPORT_SYMBOL(net_get_page_callback);
16 net_put_page_callback_t net_put_page_callback __read_mostly;
17 EXPORT_SYMBOL(net_put_page_callback);
20 * Caller of this function must ensure that at the moment when it's called
21 * there are no pages in the system with net_priv field set to non-zero
22 * value. Hence, this function, as well as net_get_page() and net_put_page(),
23 * don't need any protection.
25 int net_set_get_put_page_callbacks(
26 net_get_page_callback_t get_callback,
27 net_put_page_callback_t put_callback)
31 if ((net_get_page_callback != NULL) && (get_callback != NULL) &&
32 (net_get_page_callback != get_callback)) {
37 if ((net_put_page_callback != NULL) && (put_callback != NULL) &&
38 (net_put_page_callback != put_callback)) {
43 net_get_page_callback = get_callback;
44 net_put_page_callback = put_callback;
49 EXPORT_SYMBOL(net_set_get_put_page_callbacks);