Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Add Kirk McKusick's soft updates code to the trunk. Not ...
details: https://anonhg.NetBSD.org/src/rev/3d3e7b75f967
branches: trunk
changeset: 478358:3d3e7b75f967
user: fvdl <fvdl%NetBSD.org@localhost>
date: Mon Nov 15 18:49:07 1999 +0000
description:
Add Kirk McKusick's soft updates code to the trunk. Not enabled by
default, as the copyright on the main file (ffs_softdep.c) is such
that is has been put into gnusrc. options SOFTDEP will pull this
in. This code also contains the trickle syncer.
Bump version number to 1.4O
diffstat:
sys/adosfs/advfsops.c | 5 +-
sys/arch/i386/conf/std.i386 | 6 +-
sys/conf/files | 5 +-
sys/conf/osrelease.sh | 4 +-
sys/dev/ccd.c | 3 +-
sys/filecorefs/filecore_vfsops.c | 6 +-
sys/isofs/cd9660/cd9660_vfsops.c | 9 +-
sys/kern/init_main.c | 9 +-
sys/kern/kern_malloc.c | 6 +-
sys/kern/kern_physio.c | 3 +-
sys/kern/kern_synch.c | 4 +-
sys/kern/vfs_bio.c | 73 ++++-
sys/kern/vfs_cluster.c | 16 +-
sys/kern/vfs_init.c | 4 +-
sys/kern/vfs_subr.c | 277 ++++++++++++++++---
sys/kern/vfs_syscalls.c | 58 +++-
sys/kern/vnode_if.c | 21 +-
sys/kern/vnode_if.src | 26 +-
sys/miscfs/genfs/genfs_vnops.c | 4 +-
sys/miscfs/specfs/spec_vnops.c | 9 +-
sys/miscfs/specfs/specdev.h | 11 +-
sys/miscfs/syncfs/sync_subr.c | 244 +++++++++++++++++
sys/miscfs/syncfs/sync_vnops.c | 199 ++++++++++++++
sys/miscfs/syncfs/syncfs.h | 61 ++++
sys/msdosfs/msdosfs_vfsops.c | 14 +-
sys/msdosfs/msdosfs_vnops.c | 4 +-
sys/nfs/nfs_bio.c | 10 +-
sys/nfs/nfs_vfsops.c | 5 +-
sys/nfs/nfs_vnops.c | 14 +-
sys/ntfs/ntfs_vfsops.c | 11 +-
sys/sys/buf.h | 26 +-
sys/sys/malloc.h | 44 ++-
sys/sys/mount.h | 20 +-
sys/sys/param.h | 4 +-
sys/sys/queue.h | 10 +-
sys/sys/vnode.h | 31 ++-
sys/sys/vnode_if.h | 35 ++-
sys/ufs/ext2fs/ext2fs_vfsops.c | 13 +-
sys/ufs/ffs/ffs_alloc.c | 259 +++++++++++-------
sys/ufs/ffs/ffs_balloc.c | 120 +++++--
sys/ufs/ffs/ffs_extern.h | 39 ++-
sys/ufs/ffs/ffs_inode.c | 77 ++++-
sys/ufs/ffs/ffs_softdep.stub.c | 241 +++++++++++++++++
sys/ufs/ffs/ffs_subr.c | 26 +-
sys/ufs/ffs/ffs_vfsops.c | 122 +++++++-
sys/ufs/ffs/ffs_vnops.c | 113 +++++++-
sys/ufs/ffs/fs.h | 20 +-
sys/ufs/ffs/softdep.h | 550 +++++++++++++++++++++++++++++++++++++++
sys/ufs/lfs/lfs_alloc.c | 6 +-
sys/ufs/lfs/lfs_balloc.c | 33 +-
sys/ufs/lfs/lfs_extern.h | 8 +-
sys/ufs/lfs/lfs_segment.c | 3 +-
sys/ufs/lfs/lfs_vfsops.c | 8 +-
sys/ufs/lfs/lfs_vnops.c | 3 +-
sys/ufs/ufs/dinode.h | 4 +-
sys/ufs/ufs/inode.h | 15 +-
sys/ufs/ufs/ufs_bswap.h | 7 +-
sys/ufs/ufs/ufs_extern.h | 30 +-
sys/ufs/ufs/ufs_ihash.c | 7 +-
sys/ufs/ufs/ufs_lookup.c | 313 +++++++++++++--------
sys/ufs/ufs/ufs_quota.c | 8 +-
sys/ufs/ufs/ufs_readwrite.c | 12 +-
sys/ufs/ufs/ufs_vnops.c | 382 ++++++++++++++------------
sys/uvm/uvm_swap.c | 4 +-
64 files changed, 3010 insertions(+), 704 deletions(-)
diffs (truncated from 6776 to 300 lines):
diff -r d8319900eba0 -r 3d3e7b75f967 sys/adosfs/advfsops.c
--- a/sys/adosfs/advfsops.c Mon Nov 15 18:42:26 1999 +0000
+++ b/sys/adosfs/advfsops.c Mon Nov 15 18:49:07 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: advfsops.c,v 1.39 1999/10/20 14:32:09 enami Exp $ */
+/* $NetBSD: advfsops.c,v 1.40 1999/11/15 18:49:07 fvdl Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -235,7 +235,6 @@
mp->mnt_stat.f_fsid.val[0] = (long)devvp->v_rdev;
mp->mnt_stat.f_fsid.val[1] = makefstype(MOUNT_ADOSFS);
mp->mnt_flag |= MNT_LOCAL;
- devvp->v_specflags |= SI_MOUNTEDON;
/*
* init anode table.
@@ -301,7 +300,7 @@
return (error);
amp = VFSTOADOSFS(mp);
if (amp->devvp->v_type != VBAD)
- amp->devvp->v_specflags &= ~SI_MOUNTEDON;
+ devvp->v_specmountpoint = NULL;
vn_lock(amp->devvp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_CLOSE(amp->devvp, FREAD, NOCRED, p);
vput(amp->devvp);
diff -r d8319900eba0 -r 3d3e7b75f967 sys/arch/i386/conf/std.i386
--- a/sys/arch/i386/conf/std.i386 Mon Nov 15 18:42:26 1999 +0000
+++ b/sys/arch/i386/conf/std.i386 Mon Nov 15 18:49:07 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: std.i386,v 1.16 1999/09/12 01:17:05 chs Exp $
+# $NetBSD: std.i386,v 1.17 1999/11/15 18:49:07 fvdl Exp $
#
# standard, required NetBSD/i386 'options'
@@ -7,3 +7,7 @@
options EXEC_AOUT # exec a.out binaries
options EXEC_ELF32 # exec ELF binaries
options EXEC_SCRIPT # exec #! scripts
+
+prefix ../gnu/sys
+cinclude "conf/files.softdep"
+prefix
diff -r d8319900eba0 -r 3d3e7b75f967 sys/conf/files
--- a/sys/conf/files Mon Nov 15 18:42:26 1999 +0000
+++ b/sys/conf/files Mon Nov 15 18:49:07 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files,v 1.329 1999/11/13 05:02:25 simonb Exp $
+# $NetBSD: files,v 1.330 1999/11/15 18:49:07 fvdl Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@@ -714,6 +714,8 @@
file miscfs/procfs/procfs_vfsops.c procfs
file miscfs/procfs/procfs_vnops.c procfs
file miscfs/specfs/spec_vnops.c
+file miscfs/syncfs/sync_vnops.c
+file miscfs/syncfs/sync_subr.c
file miscfs/umapfs/umap_subr.c umapfs
file miscfs/umapfs/umap_vfsops.c umapfs
file miscfs/umapfs/umap_vnops.c umapfs
@@ -889,6 +891,7 @@
file ufs/ffs/ffs_balloc.c ffs | mfs
file ufs/ffs/ffs_bswap.c (ffs | mfs | lfs) & ffs_ei
file ufs/ffs/ffs_inode.c ffs | mfs
+file ufs/ffs/ffs_softdep.stub.c ffs & !softdep
file ufs/ffs/ffs_subr.c ffs | mfs
file ufs/ffs/ffs_tables.c ffs | mfs
file ufs/ffs/ffs_vfsops.c ffs | mfs
diff -r d8319900eba0 -r 3d3e7b75f967 sys/conf/osrelease.sh
--- a/sys/conf/osrelease.sh Mon Nov 15 18:42:26 1999 +0000
+++ b/sys/conf/osrelease.sh Mon Nov 15 18:49:07 1999 +0000
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: osrelease.sh,v 1.29 1999/11/13 00:33:05 thorpej Exp $
+# $NetBSD: osrelease.sh,v 1.30 1999/11/15 18:49:08 fvdl Exp $
#
# Copyright (c) 1997 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -38,7 +38,7 @@
#
# Release number to use
-release=1.4N
+release=1.4O
case $1 in
diff -r d8319900eba0 -r 3d3e7b75f967 sys/dev/ccd.c
--- a/sys/dev/ccd.c Mon Nov 15 18:42:26 1999 +0000
+++ b/sys/dev/ccd.c Mon Nov 15 18:49:07 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ccd.c,v 1.64 1999/11/03 16:04:03 chs Exp $ */
+/* $NetBSD: ccd.c,v 1.65 1999/11/15 18:49:08 fvdl Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -781,6 +781,7 @@
cbp->cb_buf.b_blkno = cbn + cboff;
cbp->cb_buf.b_data = addr;
cbp->cb_buf.b_vp = ci->ci_vp;
+ LIST_INIT(&cbp->cb_buf.b_dep);
if (cs->sc_ileave == 0)
cbc = dbtob((u_int64_t)(ci->ci_size - cbn));
else
diff -r d8319900eba0 -r 3d3e7b75f967 sys/filecorefs/filecore_vfsops.c
--- a/sys/filecorefs/filecore_vfsops.c Mon Nov 15 18:42:26 1999 +0000
+++ b/sys/filecorefs/filecore_vfsops.c Mon Nov 15 18:49:07 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: filecore_vfsops.c,v 1.9 1999/10/20 14:32:10 enami Exp $ */
+/* $NetBSD: filecore_vfsops.c,v 1.10 1999/11/15 18:49:08 fvdl Exp $ */
/*-
* Copyright (c) 1998 Andrew McMurry
@@ -335,8 +335,6 @@
fcmp->fc_gid = argp->gid;
}
- devvp->v_specflags |= SI_MOUNTEDON;
-
return 0;
out:
if (bp) {
@@ -394,7 +392,7 @@
fcmp = VFSTOFILECORE(mp);
if (fcmp->fc_devvp->v_type != VBAD)
- fcmp->fc_devvp->v_specflags &= ~SI_MOUNTEDON;
+ fcmp->fc_devvp->v_specmountpoint = NULL;
vn_lock(fcmp->fc_devvp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_CLOSE(fcmp->fc_devvp, FREAD, NOCRED, p);
vput(fcmp->fc_devvp);
diff -r d8319900eba0 -r 3d3e7b75f967 sys/isofs/cd9660/cd9660_vfsops.c
--- a/sys/isofs/cd9660/cd9660_vfsops.c Mon Nov 15 18:42:26 1999 +0000
+++ b/sys/isofs/cd9660/cd9660_vfsops.c Mon Nov 15 18:49:07 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660_vfsops.c,v 1.41 1999/10/20 14:32:10 enami Exp $ */
+/* $NetBSD: cd9660_vfsops.c,v 1.42 1999/11/15 18:49:08 fvdl Exp $ */
/*-
* Copyright (c) 1994
@@ -409,7 +409,7 @@
isomp->im_dev = dev;
isomp->im_devvp = devvp;
- devvp->v_specflags |= SI_MOUNTEDON;
+ devvp->v_specmountpoint = mp;
/* Check the Rock Ridge Extention support */
if (!(argp->flags & ISOFSMNT_NORRIP)) {
@@ -509,9 +509,10 @@
if (isomp->iso_ftype == ISO_FTYPE_RRIP)
iso_dunmap(isomp->im_dev);
#endif
-
+
if (isomp->im_devvp->v_type != VBAD)
- isomp->im_devvp->v_specflags &= ~SI_MOUNTEDON;
+ isomp->im_devvp->v_specmountpoint = NULL;
+
vn_lock(isomp->im_devvp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, p);
vput(isomp->im_devvp);
diff -r d8319900eba0 -r 3d3e7b75f967 sys/kern/init_main.c
--- a/sys/kern/init_main.c Mon Nov 15 18:42:26 1999 +0000
+++ b/sys/kern/init_main.c Mon Nov 15 18:49:07 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: init_main.c,v 1.158 1999/11/13 05:02:25 simonb Exp $ */
+/* $NetBSD: init_main.c,v 1.159 1999/11/15 18:49:09 fvdl Exp $ */
/*
* Copyright (c) 1995 Christopher G. Demetriou. All rights reserved.
@@ -92,6 +92,9 @@
#include <ufs/ufs/quota.h>
+#include <miscfs/genfs/genfs.h>
+#include <miscfs/syncfs/syncfs.h>
+
#include <machine/cpu.h>
#include <vm/vm.h>
@@ -423,6 +426,10 @@
if (kthread_create1(start_reaper, NULL, NULL, "reaper"))
panic("fork reaper");
+ /* Create process 4, the filesystem syncer */
+ if (kthread_create1(sched_sync, NULL, NULL, "ioflush"))
+ panic("fork syncer");
+
/* Create any other deferred kernel threads. */
kthread_run_deferred_queue();
diff -r d8319900eba0 -r 3d3e7b75f967 sys/kern/kern_malloc.c
--- a/sys/kern/kern_malloc.c Mon Nov 15 18:42:26 1999 +0000
+++ b/sys/kern/kern_malloc.c Mon Nov 15 18:49:07 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_malloc.c,v 1.45 1999/07/19 03:17:42 chs Exp $ */
+/* $NetBSD: kern_malloc.c,v 1.46 1999/11/15 18:49:09 fvdl Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -204,7 +204,7 @@
#endif
indx = BUCKETINDX(size);
kbp = &bucket[indx];
- s = splimp();
+ s = splmem();
#ifdef KMEMSTATS
while (ksp->ks_memuse >= ksp->ks_limit) {
if (flags & M_NOWAIT) {
@@ -408,7 +408,7 @@
kup = btokup(addr);
size = 1 << kup->ku_indx;
kbp = &bucket[kup->ku_indx];
- s = splimp();
+ s = splmem();
#ifdef MALLOCLOG
domlog(addr, 0, type, 2, file, line);
#endif
diff -r d8319900eba0 -r 3d3e7b75f967 sys/kern/kern_physio.c
--- a/sys/kern/kern_physio.c Mon Nov 15 18:42:26 1999 +0000
+++ b/sys/kern/kern_physio.c Mon Nov 15 18:49:07 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_physio.c,v 1.37 1999/06/17 15:47:23 thorpej Exp $ */
+/* $NetBSD: kern_physio.c,v 1.38 1999/11/15 18:49:09 fvdl Exp $ */
/*-
* Copyright (c) 1994 Christopher G. Demetriou
@@ -135,6 +135,7 @@
bp->b_dev = dev;
bp->b_error = 0;
bp->b_proc = p;
+ LIST_INIT(&bp->b_dep);
/*
* [while there are data to transfer and no I/O error]
diff -r d8319900eba0 -r 3d3e7b75f967 sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c Mon Nov 15 18:42:26 1999 +0000
+++ b/sys/kern/kern_synch.c Mon Nov 15 18:49:07 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_synch.c,v 1.66 1999/10/14 05:59:57 ross Exp $ */
+/* $NetBSD: kern_synch.c,v 1.67 1999/11/15 18:49:09 fvdl Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -225,7 +225,6 @@
register unsigned int newcpu;
int clkhz;
- wakeup((caddr_t)&lbolt);
proclist_lock_read();
for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
/*
@@ -276,6 +275,7 @@
}
proclist_unlock_read();
uvm_meter();
+ wakeup((caddr_t)&lbolt);
timeout(schedcpu, (void *)0, hz);
}
diff -r d8319900eba0 -r 3d3e7b75f967 sys/kern/vfs_bio.c
--- a/sys/kern/vfs_bio.c Mon Nov 15 18:42:26 1999 +0000
+++ b/sys/kern/vfs_bio.c Mon Nov 15 18:49:07 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_bio.c,v 1.58 1998/11/09 01:18:34 mycroft Exp $ */
+/* $NetBSD: vfs_bio.c,v 1.59 1999/11/15 18:49:09 fvdl Exp $ */
/*-
* Copyright (c) 1994 Christopher G. Demetriou
@@ -61,6 +61,8 @@
#include <vm/vm.h>
+#include <miscfs/specfs/specdev.h>
+
/* Macros to clear/set/test flags. */
#define SET(t, f) (t) |= (f)
#define CLR(t, f) (t) &= ~(f)
@@ -73,6 +75,7 @@
(&bufhashtbl[((long)(dvp) / sizeof(*(dvp)) + (int)(lbn)) & bufhash])
LIST_HEAD(bufhashhdr, buf) *bufhashtbl, invalhash;
u_long bufhash;
+struct bio_ops bioops; /* I/O operation notification */
/*
* Insq/Remq for the buffer hash lists.
@@ -149,6 +152,7 @@
bp->b_rcred = NOCRED;
bp->b_wcred = NOCRED;
bp->b_vnbufs.le_next = NOLIST;
+ LIST_INIT(&bp->b_dep);
bp->b_data = buffers + i * MAXBSIZE;
if (i < residual)
bp->b_bufsize = (base + 1) * CLBYTES;
@@ -300,6 +304,8 @@
{
int rv, sync, wasdelayed, s;
Home |
Main Index |
Thread Index |
Old Index