Deleted Added
full compact
uipc_syscalls.c (121256) uipc_syscalls.c (122780)
1/*
2 * Copyright (c) 1982, 1986, 1989, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * sendfile(2) and related extensions:
6 * Copyright (c) 1998, David Greenman. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 23 unchanged lines hidden (view full) ---

32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94
37 */
38
39#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1982, 1986, 1989, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * sendfile(2) and related extensions:
6 * Copyright (c) 1998, David Greenman. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 23 unchanged lines hidden (view full) ---

32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94
37 */
38
39#include <sys/cdefs.h>
40__FBSDID("$FreeBSD: head/sys/kern/uipc_syscalls.c 121256 2003-10-19 20:41:07Z dwmalone $");
40__FBSDID("$FreeBSD: head/sys/kern/uipc_syscalls.c 122780 2003-11-16 06:11:26Z alc $");
41
42#include "opt_compat.h"
43#include "opt_ktrace.h"
44#include "opt_mac.h"
45
46#include <sys/param.h>
47#include <sys/systm.h>
48#include <sys/kernel.h>

--- 6 unchanged lines hidden (view full) ---

55#include <sys/event.h>
56#include <sys/proc.h>
57#include <sys/fcntl.h>
58#include <sys/file.h>
59#include <sys/filio.h>
60#include <sys/mount.h>
61#include <sys/mbuf.h>
62#include <sys/protosw.h>
41
42#include "opt_compat.h"
43#include "opt_ktrace.h"
44#include "opt_mac.h"
45
46#include <sys/param.h>
47#include <sys/systm.h>
48#include <sys/kernel.h>

--- 6 unchanged lines hidden (view full) ---

55#include <sys/event.h>
56#include <sys/proc.h>
57#include <sys/fcntl.h>
58#include <sys/file.h>
59#include <sys/filio.h>
60#include <sys/mount.h>
61#include <sys/mbuf.h>
62#include <sys/protosw.h>
63#include <sys/sf_buf.h>
63#include <sys/socket.h>
64#include <sys/socketvar.h>
65#include <sys/signalvar.h>
66#include <sys/syscallsubr.h>
67#include <sys/uio.h>
68#include <sys/vnode.h>
69#ifdef KTRACE
70#include <sys/ktrace.h>

--- 1809 unchanged lines hidden (view full) ---

1880 }
1881
1882 /*
1883 * Get an mbuf header and set it up as having external storage.
1884 */
1885 MGETHDR(m, M_TRYWAIT, MT_DATA);
1886 if (m == NULL) {
1887 error = ENOBUFS;
64#include <sys/socket.h>
65#include <sys/socketvar.h>
66#include <sys/signalvar.h>
67#include <sys/syscallsubr.h>
68#include <sys/uio.h>
69#include <sys/vnode.h>
70#ifdef KTRACE
71#include <sys/ktrace.h>

--- 1809 unchanged lines hidden (view full) ---

1881 }
1882
1883 /*
1884 * Get an mbuf header and set it up as having external storage.
1885 */
1886 MGETHDR(m, M_TRYWAIT, MT_DATA);
1887 if (m == NULL) {
1888 error = ENOBUFS;
1888 sf_buf_free((void *)sf->kva, sf);
1889 sf_buf_free((void *)sf_buf_kva(sf), sf);
1889 sbunlock(&so->so_snd);
1890 goto done;
1891 }
1892 /*
1893 * Setup external storage for mbuf.
1894 */
1890 sbunlock(&so->so_snd);
1891 goto done;
1892 }
1893 /*
1894 * Setup external storage for mbuf.
1895 */
1895 MEXTADD(m, sf->kva, PAGE_SIZE, sf_buf_free, sf, M_RDONLY,
1896 MEXTADD(m, sf_buf_kva(sf), PAGE_SIZE, sf_buf_free, sf, M_RDONLY,
1896 EXT_SFBUF);
1897 EXT_SFBUF);
1897 m->m_data = (char *) sf->kva + pgoff;
1898 m->m_data = (char *)sf_buf_kva(sf) + pgoff;
1898 m->m_pkthdr.len = m->m_len = xfsize;
1899 /*
1900 * Add the buffer to the socket buffer chain.
1901 */
1902 s = splnet();
1903retry_space:
1904 /*
1905 * Make sure that the socket is still able to take more data.

--- 93 unchanged lines hidden ---
1899 m->m_pkthdr.len = m->m_len = xfsize;
1900 /*
1901 * Add the buffer to the socket buffer chain.
1902 */
1903 s = splnet();
1904retry_space:
1905 /*
1906 * Make sure that the socket is still able to take more data.

--- 93 unchanged lines hidden ---