uipc_socket.c (111161) | uipc_socket.c (111741) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94 | 1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94 |
34 * $FreeBSD: head/sys/kern/uipc_socket.c 111161 2003-02-20 03:26:11Z cognet $ | 34 * $FreeBSD: head/sys/kern/uipc_socket.c 111741 2003-03-02 15:50:23Z des $ |
35 */ 36 37#include "opt_inet.h" 38#include "opt_mac.h" 39#include "opt_zero.h" 40 41#include <sys/param.h> 42#include <sys/systm.h> --- 635 unchanged lines hidden (view full) --- 678 MH_ALIGN(m, len); 679 } 680 space -= len; 681#ifdef ZERO_COPY_SOCKETS 682 if (cow_send) 683 error = 0; 684 else 685#endif /* ZERO_COPY_SOCKETS */ | 35 */ 36 37#include "opt_inet.h" 38#include "opt_mac.h" 39#include "opt_zero.h" 40 41#include <sys/param.h> 42#include <sys/systm.h> --- 635 unchanged lines hidden (view full) --- 678 MH_ALIGN(m, len); 679 } 680 space -= len; 681#ifdef ZERO_COPY_SOCKETS 682 if (cow_send) 683 error = 0; 684 else 685#endif /* ZERO_COPY_SOCKETS */ |
686 error = uiomove(mtod(m, caddr_t), (int)len, uio); | 686 error = uiomove(mtod(m, void *), (int)len, uio); |
687 resid = uio->uio_resid; 688 m->m_len = len; 689 *mp = m; 690 top->m_pkthdr.len += len; 691 if (error) 692 goto release; 693 mp = &m->m_next; 694 if (resid <= 0) { --- 109 unchanged lines hidden (view full) --- 804 disposable = 1; 805 else 806 disposable = 0; 807 808 pg = PHYS_TO_VM_PAGE(vtophys(mtod(m, caddr_t))); 809 if (uio->uio_offset == -1) 810 uio->uio_offset =IDX_TO_OFF(pg->pindex); 811 | 687 resid = uio->uio_resid; 688 m->m_len = len; 689 *mp = m; 690 top->m_pkthdr.len += len; 691 if (error) 692 goto release; 693 mp = &m->m_next; 694 if (resid <= 0) { --- 109 unchanged lines hidden (view full) --- 804 disposable = 1; 805 else 806 disposable = 0; 807 808 pg = PHYS_TO_VM_PAGE(vtophys(mtod(m, caddr_t))); 809 if (uio->uio_offset == -1) 810 uio->uio_offset =IDX_TO_OFF(pg->pindex); 811 |
812 error = uiomoveco(mtod(m, caddr_t), | 812 error = uiomoveco(mtod(m, void *), |
813 min(uio->uio_resid, m->m_len), 814 uio, pg->object, 815 disposable); 816 } else 817#endif /* ZERO_COPY_SOCKETS */ | 813 min(uio->uio_resid, m->m_len), 814 uio, pg->object, 815 disposable); 816 } else 817#endif /* ZERO_COPY_SOCKETS */ |
818 error = uiomove(mtod(m, caddr_t), | 818 error = uiomove(mtod(m, void *), |
819 (int) min(uio->uio_resid, m->m_len), uio); 820 m = m_free(m); 821 } while (uio->uio_resid && error == 0 && m); 822bad: 823 if (m) 824 m_freem(m); 825 return (error); 826 } --- 155 unchanged lines hidden (view full) --- 982 disposable = 0; 983 984 pg = PHYS_TO_VM_PAGE(vtophys(mtod(m, caddr_t) + 985 moff)); 986 987 if (uio->uio_offset == -1) 988 uio->uio_offset =IDX_TO_OFF(pg->pindex); 989 | 819 (int) min(uio->uio_resid, m->m_len), uio); 820 m = m_free(m); 821 } while (uio->uio_resid && error == 0 && m); 822bad: 823 if (m) 824 m_freem(m); 825 return (error); 826 } --- 155 unchanged lines hidden (view full) --- 982 disposable = 0; 983 984 pg = PHYS_TO_VM_PAGE(vtophys(mtod(m, caddr_t) + 985 moff)); 986 987 if (uio->uio_offset == -1) 988 uio->uio_offset =IDX_TO_OFF(pg->pindex); 989 |
990 error = uiomoveco(mtod(m, caddr_t) + moff, | 990 error = uiomoveco(mtod(m, char *) + moff, |
991 (int)len, uio,pg->object, 992 disposable); 993 } else 994#endif /* ZERO_COPY_SOCKETS */ | 991 (int)len, uio,pg->object, 992 disposable); 993 } else 994#endif /* ZERO_COPY_SOCKETS */ |
995 error = uiomove(mtod(m, caddr_t) + moff, (int)len, uio); | 995 error = uiomove(mtod(m, char *) + moff, (int)len, uio); |
996 s = splnet(); 997 if (error) 998 goto release; 999 } else 1000 uio->uio_resid -= len; 1001 if (len == m->m_len - moff) { 1002 if (m->m_flags & M_EOR) 1003 flags |= MSG_EOR; --- 849 unchanged lines hidden --- | 996 s = splnet(); 997 if (error) 998 goto release; 999 } else 1000 uio->uio_resid -= len; 1001 if (len == m->m_len - moff) { 1002 if (m->m_flags & M_EOR) 1003 flags |= MSG_EOR; --- 849 unchanged lines hidden --- |