From owner-p4-projects@FreeBSD.ORG Sun Oct 15 15:06:38 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D20E116A416; Sun, 15 Oct 2006 15:06:37 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8036616A412 for ; Sun, 15 Oct 2006 15:06:37 +0000 (UTC) (envelope-from netchild@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 353D743D5D for ; Sun, 15 Oct 2006 15:06:35 +0000 (GMT) (envelope-from netchild@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k9FF6ZJ8091980 for ; Sun, 15 Oct 2006 15:06:35 GMT (envelope-from netchild@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9FF6X8s091972 for perforce@freebsd.org; Sun, 15 Oct 2006 15:06:33 GMT (envelope-from netchild@freebsd.org) Date: Sun, 15 Oct 2006 15:06:33 GMT Message-Id: <200610151506.k9FF6X8s091972@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to netchild@freebsd.org using -f From: Alexander Leidinger To: Perforce Change Reviews Cc: Subject: PERFORCE change 107954 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2006 15:06:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=107954 Change 107954 by netchild@netchild_magellan on 2006/10/15 15:05:38 IFC Affected files ... .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#6 integrate .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#12 integrate .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_proto.h#7 integrate .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_syscall.h#7 integrate .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysent.c#6 integrate .. //depot/projects/linuxolator/src/sys/amd64/linux32/syscalls.master#7 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_signal.c#3 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_signal.h#4 integrate .. //depot/projects/linuxolator/src/sys/conf/files.amd64#5 integrate .. //depot/projects/linuxolator/src/sys/conf/files.i386#4 integrate .. //depot/projects/linuxolator/src/sys/dev/sound/midi/sequencer.c#3 integrate .. //depot/projects/linuxolator/src/sys/i386/linux/linux.h#5 integrate .. //depot/projects/linuxolator/src/sys/i386/linux/linux_machdep.c#8 integrate .. //depot/projects/linuxolator/src/sys/i386/linux/linux_proto.h#6 integrate .. //depot/projects/linuxolator/src/sys/i386/linux/linux_syscall.h#6 integrate .. //depot/projects/linuxolator/src/sys/i386/linux/linux_sysent.c#6 integrate .. //depot/projects/linuxolator/src/sys/i386/linux/syscalls.master#5 integrate .. //depot/projects/linuxolator/src/sys/kern/sys_generic.c#3 integrate .. //depot/projects/linuxolator/src/sys/kern/sys_process.c#2 integrate .. //depot/projects/linuxolator/src/sys/kern/vfs_aio.c#5 integrate .. //depot/projects/linuxolator/src/sys/modules/aio/Makefile#4 integrate .. //depot/projects/linuxolator/src/sys/modules/linux/Makefile#3 integrate .. //depot/projects/linuxolator/src/sys/pci/agp.c#2 integrate .. //depot/projects/linuxolator/src/sys/vm/vnode_pager.c#4 integrate Differences ... ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#6 (text+ko) ==== @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/linux32/linux.h,v 1.5 2006/08/19 15:13:01 netchild Exp $ + * $FreeBSD: src/sys/amd64/linux32/linux.h,v 1.7 2006/10/15 14:22:12 netchild Exp $ */ #ifndef _AMD64_LINUX_LINUX_H_ ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#12 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.18 2006/10/02 12:59:55 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.22 2006/10/15 13:39:39 netchild Exp $"); #include #include @@ -549,7 +549,13 @@ ff |= RFMEM; if (args->flags & CLONE_SIGHAND) ff |= RFSIGSHARE; - if (!(args->flags & CLONE_FILES)) + /* + * XXX: in linux sharing of fs info (chroot/cwd/umask) + * and open files is independant. in fbsd its in one + * structure but in reality it doesnt make any problems + * because both this flags are set at once usually. + */ + if (!(args->flags & (CLONE_FILES | CLONE_FS))) ff |= RFFDG; /* ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_proto.h#7 (text+ko) ==== @@ -2,8 +2,8 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp + * $FreeBSD: src/sys/amd64/linux32/linux32_proto.h,v 1.23 2006/10/15 14:24:09 netchild Exp $ + * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.21 2006/10/15 14:22:12 netchild Exp */ #ifndef _LINUX_SYSPROTO_H_ ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_syscall.h#7 (text+ko) ==== @@ -2,8 +2,8 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp + * $FreeBSD: src/sys/amd64/linux32/linux32_syscall.h,v 1.23 2006/10/15 14:24:09 netchild Exp $ + * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.21 2006/10/15 14:22:12 netchild Exp */ #define LINUX_SYS_exit 1 ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysent.c#6 (text+ko) ==== @@ -2,8 +2,8 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp + * $FreeBSD: src/sys/amd64/linux32/linux32_sysent.c,v 1.23 2006/10/15 14:24:09 netchild Exp $ + * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.21 2006/10/15 14:22:12 netchild Exp */ #include ==== //depot/projects/linuxolator/src/sys/amd64/linux32/syscalls.master#7 (text+ko) ==== @@ -1,4 +1,4 @@ - $FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp $ + $FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.21 2006/10/15 14:22:12 netchild Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 ; System call name/number master file (or rather, slave, from LINUX). ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_signal.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_signal.c,v 1.59 2006/08/19 15:13:01 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_signal.c,v 1.61 2006/10/15 14:34:03 netchild Exp $"); #include #include ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_signal.h#4 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/linux/linux_signal.h,v 1.6 2002/03/20 05:42:02 alfred Exp $ + * $FreeBSD: src/sys/compat/linux/linux_signal.h,v 1.7 2006/10/15 12:51:43 netchild Exp $ */ #ifndef _LINUX_SIGNAL_H_ ==== //depot/projects/linuxolator/src/sys/conf/files.amd64#5 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.amd64,v 1.94 2006/09/22 22:11:28 jhb Exp $ +# $FreeBSD: src/sys/conf/files.amd64,v 1.95 2006/10/15 14:22:13 netchild Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and ==== //depot/projects/linuxolator/src/sys/conf/files.i386#4 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.i386,v 1.566 2006/09/22 22:11:28 jhb Exp $ +# $FreeBSD: src/sys/conf/files.i386,v 1.567 2006/10/15 14:22:13 netchild Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and ==== //depot/projects/linuxolator/src/sys/dev/sound/midi/sequencer.c#3 (text) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/sound/midi/sequencer.c,v 1.22 2006/09/29 09:28:22 ru Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/sound/midi/sequencer.c,v 1.23 2006/10/15 08:23:48 ariff Exp $"); #include #include @@ -613,7 +613,7 @@ int i; //SEQ_DEBUG(4,printf("seq_delunit: %d\n", unit)); - printf("seq_delunit: 1 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 1 \n")); mtx_lock(&scp->seq_lock); scp->playing = 0; @@ -621,46 +621,46 @@ cv_broadcast(&scp->out_cv); cv_broadcast(&scp->state_cv); cv_broadcast(&scp->reset_cv); - printf("seq_delunit: 2 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 2 \n")); cv_wait(&scp->th_cv, &scp->seq_lock); - printf("seq_delunit: 3.0 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 3.0 \n")); mtx_unlock(&scp->seq_lock); - printf("seq_delunit: 3.1 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 3.1 \n")); cv_destroy(&scp->state_cv); - printf("seq_delunit: 4 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 4 \n")); cv_destroy(&scp->empty_cv); - printf("seq_delunit: 5 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 5 \n")); cv_destroy(&scp->reset_cv); - printf("seq_delunit: 6 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 6 \n")); cv_destroy(&scp->out_cv); - printf("seq_delunit: 7 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 7 \n")); cv_destroy(&scp->in_cv); - printf("seq_delunit: 8 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 8 \n")); cv_destroy(&scp->th_cv); - printf("seq_delunit: 10 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 10 \n")); if (scp->seqdev) destroy_dev(scp->seqdev); - printf("seq_delunit: 11 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 11 \n")); if (scp->musicdev) destroy_dev(scp->musicdev); - printf("seq_delunit: 12 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 12 \n")); scp->seqdev = scp->musicdev = NULL; if (scp->midis != NULL) free(scp->midis, M_TEMP); - printf("seq_delunit: 13 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 13 \n")); if (scp->midi_flags != NULL) free(scp->midi_flags, M_TEMP); - printf("seq_delunit: 14 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 14 \n")); free(scp->out_q.b, M_TEMP); - printf("seq_delunit: 15 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 15 \n")); free(scp->in_q.b, M_TEMP); - printf("seq_delunit: 16 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 16 \n")); mtx_destroy(&scp->seq_lock); - printf("seq_delunit: 17 \n"); + SEQ_DEBUG(1, printf("seq_delunit: 17 \n")); free(scp, M_DEVBUF); mtx_lock(&seqinfo_mtx); @@ -1391,7 +1391,7 @@ struct seq_softc *scp = i_dev->si_drv1; SEQ_DEBUG(3, printf("seq_poll: unit %d.\n", scp->unit)); - printf("seq_poll: unit %d.\n", scp->unit); + SEQ_DEBUG(1, printf("seq_poll: unit %d.\n", scp->unit)); mtx_lock(&scp->seq_lock); @@ -1869,7 +1869,7 @@ SEQ_DEBUG(5,printf("seq_local: unit %d, cmd %d\n", scp->unit, event[1])); switch (event[1]) { default: - printf("seq_local event type %d not handled\n", event[1]); + SEQ_DEBUG(1, printf("seq_local event type %d not handled\n", event[1])); ret = 1; break; } ==== //depot/projects/linuxolator/src/sys/i386/linux/linux.h#5 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/linux/linux.h,v 1.68 2006/08/19 15:13:01 netchild Exp $ + * $FreeBSD: src/sys/i386/linux/linux.h,v 1.70 2006/10/15 14:22:13 netchild Exp $ */ #ifndef _I386_LINUX_LINUX_H_ ==== //depot/projects/linuxolator/src/sys/i386/linux/linux_machdep.c#8 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/linux/linux_machdep.c,v 1.57 2006/09/20 19:27:11 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/linux/linux_machdep.c,v 1.62 2006/10/15 13:39:40 netchild Exp $"); #include #include ==== //depot/projects/linuxolator/src/sys/i386/linux/linux_proto.h#6 (text+ko) ==== @@ -2,8 +2,8 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.80 2006/09/21 16:18:33 rwatson Exp + * $FreeBSD: src/sys/i386/linux/linux_proto.h,v 1.84 2006/10/15 14:24:09 netchild Exp $ + * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.81 2006/10/15 14:22:13 netchild Exp */ #ifndef _LINUX_SYSPROTO_H_ ==== //depot/projects/linuxolator/src/sys/i386/linux/linux_syscall.h#6 (text+ko) ==== @@ -2,8 +2,8 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.80 2006/09/21 16:18:33 rwatson Exp + * $FreeBSD: src/sys/i386/linux/linux_syscall.h,v 1.78 2006/10/15 14:24:09 netchild Exp $ + * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.81 2006/10/15 14:22:13 netchild Exp */ #define LINUX_SYS_exit 1 ==== //depot/projects/linuxolator/src/sys/i386/linux/linux_sysent.c#6 (text+ko) ==== @@ -2,8 +2,8 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.80 2006/09/21 16:18:33 rwatson Exp + * $FreeBSD: src/sys/i386/linux/linux_sysent.c,v 1.85 2006/10/15 14:24:10 netchild Exp $ + * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.81 2006/10/15 14:22:13 netchild Exp */ #include ==== //depot/projects/linuxolator/src/sys/i386/linux/syscalls.master#5 (text+ko) ==== @@ -1,4 +1,4 @@ - $FreeBSD: src/sys/i386/linux/syscalls.master,v 1.80 2006/09/21 16:18:33 rwatson Exp $ + $FreeBSD: src/sys/i386/linux/syscalls.master,v 1.81 2006/10/15 14:22:13 netchild Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 ; System call name/number master file (or rather, slave, from LINUX). ==== //depot/projects/linuxolator/src/sys/kern/sys_generic.c#3 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/sys_generic.c,v 1.150 2006/09/27 19:57:00 ru Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/sys_generic.c,v 1.151 2006/10/14 19:01:55 ru Exp $"); #include "opt_compat.h" #include "opt_ktrace.h" @@ -565,7 +565,8 @@ if (com & IOC_IN) { error = copyin(uap->data, data, (u_int)size); if (error) { - free(data, M_IOCTLOPS); + if (size > 0) + free(data, M_IOCTLOPS); return (error); } } else if (com & IOC_OUT) { ==== //depot/projects/linuxolator/src/sys/kern/sys_process.c#2 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/sys_process.c,v 1.138 2006/08/20 10:29:08 cperciva Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/sys_process.c,v 1.139 2006/10/14 10:30:14 trhodes Exp $"); #include "opt_compat.h" @@ -980,7 +980,7 @@ error = copyout(buf, addr, tmp * sizeof(lwpid_t)); free(buf, M_TEMP); if (!error) - td->td_retval[0] = num; + td->td_retval[0] = tmp; PROC_LOCK(p); break; ==== //depot/projects/linuxolator/src/sys/kern/vfs_aio.c#5 (text+ko) ==== @@ -19,7 +19,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/vfs_aio.c,v 1.227 2006/09/24 04:47:47 jmg Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/vfs_aio.c,v 1.228 2006/10/15 14:22:13 netchild Exp $"); #include #include @@ -313,12 +313,12 @@ static TAILQ_HEAD(,aiocblist) aio_jobs; /* (c) Async job list */ static struct unrhdr *aiod_unr; -void aio_init_aioinfo(struct proc *p); +void aio_init_aioinfo(struct proc *p); static void aio_onceonly(void); static int aio_free_entry(struct aiocblist *aiocbe); static void aio_process(struct aiocblist *aiocbe); static int aio_newproc(int *); -int aio_aqueue(struct thread *td, struct aiocb *job, +int aio_aqueue(struct thread *td, struct aiocb *job, struct aioliojob *lio, int type, int osigev); static void aio_physwakeup(struct buf *bp); static void aio_proc_rundown(void *arg, struct proc *p); ==== //depot/projects/linuxolator/src/sys/modules/aio/Makefile#4 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/modules/aio/Makefile,v 1.1 2001/12/29 07:13:47 alfred Exp $ +# $FreeBSD: src/sys/modules/aio/Makefile,v 1.2 2006/10/15 14:22:13 netchild Exp $ .PATH: ${.CURDIR}/../../kern ==== //depot/projects/linuxolator/src/sys/modules/linux/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/modules/linux/Makefile,v 1.68 2006/08/15 13:01:36 netchild Exp $ +# $FreeBSD: src/sys/modules/linux/Makefile,v 1.69 2006/10/15 14:22:14 netchild Exp $ .if ${MACHINE_ARCH} == "amd64" SFX= 32 ==== //depot/projects/linuxolator/src/sys/pci/agp.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/pci/agp.c,v 1.53 2006/08/11 19:16:50 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/pci/agp.c,v 1.54 2006/10/15 05:04:06 tanimura Exp $"); #include "opt_bus.h" @@ -180,7 +180,7 @@ free(gatt, M_AGP); } -static int agp_max[][2] = { +static u_int agp_max[][2] = { {0, 0}, {32, 4}, {64, 28}, @@ -197,7 +197,8 @@ agp_generic_attach(device_t dev) { struct agp_softc *sc = device_get_softc(dev); - int rid, memsize, i; + int rid, i; + u_int memsize; /* * Find and map the aperture. ==== //depot/projects/linuxolator/src/sys/vm/vnode_pager.c#4 (text+ko) ==== @@ -51,7 +51,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/vm/vnode_pager.c,v 1.230 2006/10/10 18:26:18 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/vm/vnode_pager.c,v 1.232 2006/10/14 23:21:48 alc Exp $"); #include #include @@ -75,8 +75,8 @@ #include #include -static daddr_t vnode_pager_addr(struct vnode *vp, vm_ooffset_t address, - int *run); +static int vnode_pager_addr(struct vnode *vp, vm_ooffset_t address, + daddr_t *rtaddress, int *run); static int vnode_pager_input_smlfs(vm_object_t object, vm_page_t m); static int vnode_pager_input_old(vm_object_t object, vm_page_t m); static void vnode_pager_dealloc(vm_object_t); @@ -437,15 +437,11 @@ * calculate the linear (byte) disk address of specified virtual * file address */ -static daddr_t -vnode_pager_addr(vp, address, run) - struct vnode *vp; - vm_ooffset_t address; - int *run; +static int +vnode_pager_addr(struct vnode *vp, vm_ooffset_t address, daddr_t *rtaddress, + int *run) { - daddr_t rtaddress; int bsize; - daddr_t block; int err; daddr_t vblock; daddr_t voffset; @@ -460,12 +456,10 @@ vblock = address / bsize; voffset = address % bsize; - err = VOP_BMAP(vp, vblock, NULL, &block, run, NULL); - - if (err || (block == -1)) - rtaddress = -1; - else { - rtaddress = block + voffset / DEV_BSIZE; + err = VOP_BMAP(vp, vblock, NULL, rtaddress, run, NULL); + if (err == 0) { + if (*rtaddress != -1) + *rtaddress += voffset / DEV_BSIZE; if (run) { *run += 1; *run *= bsize/PAGE_SIZE; @@ -473,7 +467,7 @@ } } - return rtaddress; + return (err); } /* @@ -513,7 +507,9 @@ if (address >= object->un_pager.vnp.vnp_size) { fileaddr = -1; } else { - fileaddr = vnode_pager_addr(vp, address, NULL); + error = vnode_pager_addr(vp, address, &fileaddr, NULL); + if (error) + break; } if (fileaddr != -1) { bp = getpbuf(&vnode_pbuf_freecnt); @@ -804,8 +800,17 @@ * calculate the run that includes the required page */ for (first = 0, i = 0; i < count; i = runend) { - firstaddr = vnode_pager_addr(vp, - IDX_TO_OFF(m[i]->pindex), &runpg); + if (vnode_pager_addr(vp, IDX_TO_OFF(m[i]->pindex), &firstaddr, + &runpg) != 0) { + VM_OBJECT_LOCK(object); + vm_page_lock_queues(); + for (; i < count; i++) + if (i != reqpage) + vm_page_free(m[i]); + vm_page_unlock_queues(); + VM_OBJECT_UNLOCK(object); + return (VM_PAGER_ERROR); + } if (firstaddr == -1) { VM_OBJECT_LOCK(object); if (i == reqpage && foff < object->un_pager.vnp.vnp_size) { @@ -852,9 +857,7 @@ * to be zero based... */ if (first != 0) { - for (i = first; i < count; i++) { - m[i - first] = m[i]; - } + m += first; count -= first; reqpage -= first; }