Deleted Added
full compact
subr_hash.c (127911) subr_hash.c (130023)
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.

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

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94
35 */
36
37#include <sys/cdefs.h>
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.

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

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/kern/kern_subr.c 127911 2004-04-05 21:03:37Z imp $");
38__FBSDID("$FreeBSD: head/sys/kern/kern_subr.c 130023 2004-06-03 01:47:37Z tjr $");
39
40#include "opt_zero.h"
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/kernel.h>
45#include <sys/ktr.h>
46#include <sys/limits.h>

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

135 int save = 0;
136
137 KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE,
138 ("uiomove: mode"));
139 KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread,
140 ("uiomove proc"));
141
142 if (td) {
39
40#include "opt_zero.h"
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/kernel.h>
45#include <sys/ktr.h>
46#include <sys/limits.h>

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

135 int save = 0;
136
137 KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE,
138 ("uiomove: mode"));
139 KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread,
140 ("uiomove proc"));
141
142 if (td) {
143 mtx_lock_spin(&sched_lock);
144 save = td->td_flags & TDF_DEADLKTREAT;
145 td->td_flags |= TDF_DEADLKTREAT;
146 mtx_unlock_spin(&sched_lock);
143 save = td->td_pflags & TDP_DEADLKTREAT;
144 td->td_pflags |= TDP_DEADLKTREAT;
147 }
148
149 while (n > 0 && uio->uio_resid) {
150 iov = uio->uio_iov;
151 cnt = iov->iov_len;
152 if (cnt == 0) {
153 uio->uio_iov++;
154 uio->uio_iovcnt--;

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

182 iov->iov_base = (char *)iov->iov_base + cnt;
183 iov->iov_len -= cnt;
184 uio->uio_resid -= cnt;
185 uio->uio_offset += cnt;
186 cp = (char *)cp + cnt;
187 n -= cnt;
188 }
189out:
145 }
146
147 while (n > 0 && uio->uio_resid) {
148 iov = uio->uio_iov;
149 cnt = iov->iov_len;
150 if (cnt == 0) {
151 uio->uio_iov++;
152 uio->uio_iovcnt--;

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

180 iov->iov_base = (char *)iov->iov_base + cnt;
181 iov->iov_len -= cnt;
182 uio->uio_resid -= cnt;
183 uio->uio_offset += cnt;
184 cp = (char *)cp + cnt;
185 n -= cnt;
186 }
187out:
190 if (td && save == 0) {
191 mtx_lock_spin(&sched_lock);
192 td->td_flags &= ~TDF_DEADLKTREAT;
193 mtx_unlock_spin(&sched_lock);
194 }
188 if (td && save == 0)
189 td->td_pflags &= ~TDP_DEADLKTREAT;
195 return (error);
196}
197
198/*
199 * Wrapper for uiomove() that validates the arguments against a known-good
200 * kernel buffer. Currently, uiomove accepts a signed (n) argument, which
201 * is almost definitely a bad thing, so we catch that here as well. We
202 * return a runtime failure, but it might be desirable to generate a runtime

--- 318 unchanged lines hidden ---
190 return (error);
191}
192
193/*
194 * Wrapper for uiomove() that validates the arguments against a known-good
195 * kernel buffer. Currently, uiomove accepts a signed (n) argument, which
196 * is almost definitely a bad thing, so we catch that here as well. We
197 * return a runtime failure, but it might be desirable to generate a runtime

--- 318 unchanged lines hidden ---