Deleted Added
full compact
kern_sendfile.c (175294) kern_sendfile.c (175845)
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

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

28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94
33 */
34
35#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

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

28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/kern/uipc_syscalls.c 175294 2008-01-13 14:44:15Z attilio $");
36__FBSDID("$FreeBSD: head/sys/kern/uipc_syscalls.c 175845 2008-01-31 08:22:24Z rwatson $");
37
38#include "opt_sctp.h"
39#include "opt_compat.h"
40#include "opt_ktrace.h"
41#include "opt_mac.h"
42
43#include <sys/param.h>
44#include <sys/systm.h>

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

1858 if (m == NULL) {
1859 error = mnw ? EAGAIN : ENOBUFS;
1860 goto out;
1861 }
1862 hdrlen = m_length(m, NULL);
1863 }
1864 }
1865
37
38#include "opt_sctp.h"
39#include "opt_compat.h"
40#include "opt_ktrace.h"
41#include "opt_mac.h"
42
43#include <sys/param.h>
44#include <sys/systm.h>

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

1858 if (m == NULL) {
1859 error = mnw ? EAGAIN : ENOBUFS;
1860 goto out;
1861 }
1862 hdrlen = m_length(m, NULL);
1863 }
1864 }
1865
1866 /* Protect against multiple writers to the socket. */
1867 (void) sblock(&so->so_snd, M_WAITOK);
1866 /*
1867 * Protect against multiple writers to the socket.
1868 *
1869 * XXXRW: Historically this has assumed non-interruptibility, so now
1870 * we implement that, but possibly shouldn't.
1871 */
1872 (void)sblock(&so->so_snd, SBL_WAIT | SBL_NOINTR);
1868
1869 /*
1870 * Loop through the pages of the file, starting with the requested
1871 * offset. Get a file page (do I/O if necessary), map the file page
1872 * into an sf_buf, attach an mbuf header to the sf_buf, and queue
1873 * it on the socket.
1874 * This is done in two loops. The inner loop turns as many pages
1875 * as it can, up to available socket buffer space, without blocking

--- 754 unchanged lines hidden ---
1873
1874 /*
1875 * Loop through the pages of the file, starting with the requested
1876 * offset. Get a file page (do I/O if necessary), map the file page
1877 * into an sf_buf, attach an mbuf header to the sf_buf, and queue
1878 * it on the socket.
1879 * This is done in two loops. The inner loop turns as many pages
1880 * as it can, up to available socket buffer space, without blocking

--- 754 unchanged lines hidden ---