From 908b5ff6c75734cb1c729163dc81aa9e670aea44 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 24 Jun 2003 02:12:00 +0000 Subject: [PATCH] proc->thread stage 3.5: Add an IO_CORE flag so coda doesn't have to dig into the user process structure. --- sys/kern/imgact_aout.c | 6 +++--- sys/kern/imgact_elf.c | 6 +++--- sys/sys/vnode.h | 23 ++++++++++++----------- sys/vfs/coda/coda_vnops.c | 4 ++-- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index 99ffdef3a9..dfeddbee69 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/imgact_aout.c,v 1.59.2.5 2001/11/03 01:41:08 ps Exp $ - * $DragonFly: src/sys/kern/imgact_aout.c,v 1.2 2003/06/17 04:28:41 dillon Exp $ + * $DragonFly: src/sys/kern/imgact_aout.c,v 1.3 2003/06/24 02:11:55 dillon Exp $ */ #include @@ -262,13 +262,13 @@ aout_coredump(p, vp, limit) if (error == 0) error = vn_rdwr_inchunks(UIO_WRITE, vp, vm->vm_daddr, (int)ctob(vm->vm_dsize), (off_t)ctob(UPAGES), UIO_USERSPACE, - IO_UNIT | IO_DIRECT, cred, (int *) NULL, p); + IO_UNIT | IO_DIRECT | IO_CORE, cred, (int *) NULL, p); if (error == 0) error = vn_rdwr_inchunks(UIO_WRITE, vp, (caddr_t) trunc_page(USRSTACK - ctob(vm->vm_ssize)), round_page(ctob(vm->vm_ssize)), (off_t)ctob(UPAGES) + ctob(vm->vm_dsize), UIO_USERSPACE, - IO_UNIT | IO_DIRECT, cred, (int *) NULL, p); + IO_UNIT | IO_DIRECT | IO_CORE, cred, (int *) NULL, p); return (error); } diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 8629a85c3d..a6798f490b 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/kern/imgact_elf.c,v 1.73.2.13 2002/12/28 19:49:41 dillon Exp $ - * $DragonFly: src/sys/kern/imgact_elf.c,v 1.2 2003/06/17 04:28:41 dillon Exp $ + * $DragonFly: src/sys/kern/imgact_elf.c,v 1.3 2003/06/24 02:11:55 dillon Exp $ */ #include @@ -818,7 +818,7 @@ elf_coredump(p, vp, limit) error = vn_rdwr_inchunks(UIO_WRITE, vp, (caddr_t)php->p_vaddr, php->p_filesz, offset, UIO_USERSPACE, - IO_UNIT | IO_DIRECT, cred, (int *)NULL, p); + IO_UNIT | IO_DIRECT | IO_CORE, cred, (int *)NULL, p); if (error != 0) break; offset += php->p_filesz; @@ -993,7 +993,7 @@ elf_corehdr(p, vp, cred, numsegs, hdr, hdrsize) /* Write it to the core file. */ return vn_rdwr_inchunks(UIO_WRITE, vp, hdr, hdrsize, (off_t)0, - UIO_SYSSPACE, IO_UNIT | IO_DIRECT, cred, NULL, p); + UIO_SYSSPACE, IO_UNIT | IO_DIRECT | IO_CORE, cred, NULL, p); } static void diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 3f0486d818..4a50111452 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -32,7 +32,7 @@ * * @(#)vnode.h 8.7 (Berkeley) 2/4/94 * $FreeBSD: src/sys/sys/vnode.h,v 1.111.2.19 2002/12/29 18:19:53 dillon Exp $ - * $DragonFly: src/sys/sys/vnode.h,v 1.2 2003/06/17 04:28:59 dillon Exp $ + * $DragonFly: src/sys/sys/vnode.h,v 1.3 2003/06/24 02:12:00 dillon Exp $ */ #ifndef _SYS_VNODE_H_ @@ -207,16 +207,17 @@ struct vattr { * Flags for ioflag. (high 16 bits used to ask for read-ahead and * help with write clustering) */ -#define IO_UNIT 0x01 /* do I/O as atomic unit */ -#define IO_APPEND 0x02 /* append write to end */ -#define IO_SYNC 0x04 /* do I/O synchronously */ -#define IO_NODELOCKED 0x08 /* underlying node already locked */ -#define IO_NDELAY 0x10 /* FNDELAY flag set in file table */ -#define IO_VMIO 0x20 /* data already in VMIO space */ -#define IO_INVAL 0x40 /* invalidate after I/O */ -#define IO_ASYNC 0x80 /* bawrite rather then bdwrite */ -#define IO_DIRECT 0x100 /* attempt to bypass buffer cache */ -#define IO_NOWDRAIN 0x200 /* do not block on wdrain */ +#define IO_UNIT 0x0001 /* do I/O as atomic unit */ +#define IO_APPEND 0x0002 /* append write to end */ +#define IO_SYNC 0x0004 /* do I/O synchronously */ +#define IO_NODELOCKED 0x0008 /* underlying node already locked */ +#define IO_NDELAY 0x0010 /* FNDELAY flag set in file table */ +#define IO_VMIO 0x0020 /* data already in VMIO space */ +#define IO_INVAL 0x0040 /* invalidate after I/O */ +#define IO_ASYNC 0x0080 /* bawrite rather then bdwrite */ +#define IO_DIRECT 0x0100 /* attempt to bypass buffer cache */ +#define IO_NOWDRAIN 0x0200 /* do not block on wdrain */ +#define IO_CORE 0x0400 /* I/O is part of core dump */ #define IO_SEQMAX 0x7F /* seq heuristic max value */ #define IO_SEQSHIFT 16 /* seq heuristic in upper 16 bits */ diff --git a/sys/vfs/coda/coda_vnops.c b/sys/vfs/coda/coda_vnops.c index 034b10cda4..50e68bc4da 100644 --- a/sys/vfs/coda/coda_vnops.c +++ b/sys/vfs/coda/coda_vnops.c @@ -28,7 +28,7 @@ * * @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ * $FreeBSD: src/sys/coda/coda_vnops.c,v 1.22.2.1 2001/06/29 16:26:22 shafeeq Exp $ - * $DragonFly: src/sys/vfs/coda/Attic/coda_vnops.c,v 1.2 2003/06/17 04:28:19 dillon Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_vnops.c,v 1.3 2003/06/24 02:11:53 dillon Exp $ * */ @@ -438,7 +438,7 @@ coda_rdwr(vp, uiop, rw, ioflag, cred, p) * venus won't have the correct size of the core when * it's completely written. */ - if (cp->c_inode != 0 && !(p && (p->p_acflag & ACORE))) { + if (cp->c_inode != 0 && (ioflag & IO_CORE) == 0) { igot_internally = 1; error = coda_grab_vnode(cp->c_device, cp->c_inode, &cfvp); if (error) { -- 2.41.0