Deleted Added
full compact
subr_hash.c (68862) subr_hash.c (70861)
1/*
2 * Copyright (c) 1982, 1986, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94
1/*
2 * Copyright (c) 1982, 1986, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94
39 * $FreeBSD: head/sys/kern/kern_subr.c 68862 2000-11-17 18:09:18Z jake $
39 * $FreeBSD: head/sys/kern/kern_subr.c 70861 2001-01-10 04:43:51Z jake $
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/kernel.h>
45#include <sys/ktr.h>
46#include <sys/proc.h>
47#include <sys/malloc.h>

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

87 }
88 if (cnt > n)
89 cnt = n;
90
91 switch (uio->uio_segflg) {
92
93 case UIO_USERSPACE:
94 case UIO_USERISPACE:
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/kernel.h>
45#include <sys/ktr.h>
46#include <sys/proc.h>
47#include <sys/malloc.h>

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

87 }
88 if (cnt > n)
89 cnt = n;
90
91 switch (uio->uio_segflg) {
92
93 case UIO_USERSPACE:
94 case UIO_USERISPACE:
95 if (ticks - switchticks >= hogticks)
95 if (ticks - PCPU_GET(switchticks) >= hogticks)
96 uio_yield();
97 if (uio->uio_rw == UIO_READ)
98 error = copyout(cp, iov->iov_base, cnt);
99 else
100 error = copyin(iov->iov_base, cp, cnt);
101 if (error)
102 break;
103 break;

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

149 }
150 if (cnt > n)
151 cnt = n;
152
153 switch (uio->uio_segflg) {
154
155 case UIO_USERSPACE:
156 case UIO_USERISPACE:
96 uio_yield();
97 if (uio->uio_rw == UIO_READ)
98 error = copyout(cp, iov->iov_base, cnt);
99 else
100 error = copyin(iov->iov_base, cp, cnt);
101 if (error)
102 break;
103 break;

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

149 }
150 if (cnt > n)
151 cnt = n;
152
153 switch (uio->uio_segflg) {
154
155 case UIO_USERSPACE:
156 case UIO_USERISPACE:
157 if (ticks - switchticks >= hogticks)
157 if (ticks - PCPU_GET(switchticks) >= hogticks)
158 uio_yield();
159 if (uio->uio_rw == UIO_READ) {
160#ifdef ENABLE_VFS_IOOPT
161 if (vfs_ioopt && ((cnt & PAGE_MASK) == 0) &&
162 ((((intptr_t) iov->iov_base) & PAGE_MASK) == 0) &&
163 ((uio->uio_offset & PAGE_MASK) == 0) &&
164 ((((intptr_t) cp) & PAGE_MASK) == 0)) {
165 error = vm_uiomove(&curproc->p_vmspace->vm_map, obj,

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

231 ((((intptr_t) iov->iov_base) & PAGE_MASK) == 0) &&
232 ((uio->uio_offset & PAGE_MASK) == 0) ) {
233
234 if (cnt < PAGE_SIZE)
235 break;
236
237 cnt &= ~PAGE_MASK;
238
158 uio_yield();
159 if (uio->uio_rw == UIO_READ) {
160#ifdef ENABLE_VFS_IOOPT
161 if (vfs_ioopt && ((cnt & PAGE_MASK) == 0) &&
162 ((((intptr_t) iov->iov_base) & PAGE_MASK) == 0) &&
163 ((uio->uio_offset & PAGE_MASK) == 0) &&
164 ((((intptr_t) cp) & PAGE_MASK) == 0)) {
165 error = vm_uiomove(&curproc->p_vmspace->vm_map, obj,

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

231 ((((intptr_t) iov->iov_base) & PAGE_MASK) == 0) &&
232 ((uio->uio_offset & PAGE_MASK) == 0) ) {
233
234 if (cnt < PAGE_SIZE)
235 break;
236
237 cnt &= ~PAGE_MASK;
238
239 if (ticks - switchticks >= hogticks)
239 if (ticks - PCPU_GET(switchticks) >= hogticks)
240 uio_yield();
241 error = vm_uiomove(&curproc->p_vmspace->vm_map, obj,
242 uio->uio_offset, cnt,
243 (vm_offset_t) iov->iov_base, &npagesmoved);
244
245 if (npagesmoved == 0)
246 break;
247

--- 142 unchanged lines hidden ---
240 uio_yield();
241 error = vm_uiomove(&curproc->p_vmspace->vm_map, obj,
242 uio->uio_offset, cnt,
243 (vm_offset_t) iov->iov_base, &npagesmoved);
244
245 if (npagesmoved == 0)
246 break;
247

--- 142 unchanged lines hidden ---