diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-27 07:15:50 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-27 07:15:50 +0000 |
commit | d48722a57ff478c55d87206126e148c56673d300 (patch) | |
tree | 840d49d522d83464124930376884eb97537f5562 /sys | |
parent | 16240c4ec5e2a3be1a664e6d9485e058fd0b6589 (diff) |
From NetBSD: update to 960217 sources
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/mfs/mfs_extern.h | 40 | ||||
-rw-r--r-- | sys/ufs/mfs/mfs_vfsops.c | 29 | ||||
-rw-r--r-- | sys/ufs/mfs/mfs_vnops.c | 75 | ||||
-rw-r--r-- | sys/ufs/mfs/mfsnode.h | 65 |
4 files changed, 118 insertions, 91 deletions
diff --git a/sys/ufs/mfs/mfs_extern.h b/sys/ufs/mfs/mfs_extern.h index f7e2c63f208..bd14c23226d 100644 --- a/sys/ufs/mfs/mfs_extern.h +++ b/sys/ufs/mfs/mfs_extern.h @@ -1,4 +1,5 @@ -/* $NetBSD: mfs_extern.h,v 1.3 1994/12/14 13:03:51 mycroft Exp $ */ +/* $OpenBSD: mfs_extern.h,v 1.2 1996/02/27 07:15:46 niklas Exp $ */ +/* $NetBSD: mfs_extern.h,v 1.4 1996/02/09 22:31:27 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -44,19 +45,26 @@ struct ucred; struct vnode; __BEGIN_DECLS -int mfs_badop __P((void)); -int mfs_bmap __P((struct vop_bmap_args *)); -int mfs_close __P((struct vop_close_args *)); -void mfs_doio __P((struct buf *bp, caddr_t base)); -int mfs_inactive __P((struct vop_inactive_args *)); /* XXX */ -int mfs_reclaim __P((struct vop_reclaim_args *)); -int mfs_init __P((void)); -int mfs_ioctl __P((struct vop_ioctl_args *)); -int mfs_mount __P((struct mount *mp, - char *path, caddr_t data, struct nameidata *ndp, struct proc *p)); -int mfs_open __P((struct vop_open_args *)); -int mfs_print __P((struct vop_print_args *)); /* XXX */ -int mfs_start __P((struct mount *mp, int flags, struct proc *p)); -int mfs_statfs __P((struct mount *mp, struct statfs *sbp, struct proc *p)); -int mfs_strategy __P((struct vop_strategy_args *)); /* XXX */ +/* mfs_vfsops.c */ +int mfs_mountroot __P((void)); +int mfs_initminiroot __P((caddr_t)); +int mfs_mount __P((struct mount *, char *, caddr_t, + struct nameidata *, struct proc *)); +int mfs_start __P((struct mount *, int, struct proc *)); +int mfs_statfs __P((struct mount *, struct statfs *, struct proc *)); + +void mfs_init __P((void)); + +/* mfs_vnops.c */ +int mfs_open __P((void *)); +int mfs_ioctl __P((void *)); +int mfs_strategy __P((void *)); +void mfs_doio __P((struct buf *, caddr_t)); +int mfs_bmap __P((void *)); +int mfs_close __P((void *)); +int mfs_inactive __P((void *)); +int mfs_reclaim __P((void *)); +int mfs_print __P((void *)); +int mfs_badop __P((void *)); + __END_DECLS diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c index e42968473bc..577325fe95b 100644 --- a/sys/ufs/mfs/mfs_vfsops.c +++ b/sys/ufs/mfs/mfs_vfsops.c @@ -1,4 +1,5 @@ -/* $NetBSD: mfs_vfsops.c,v 1.9 1995/09/01 19:39:18 mycroft Exp $ */ +/* $OpenBSD: mfs_vfsops.c,v 1.2 1996/02/27 07:15:47 niklas Exp $ */ +/* $NetBSD: mfs_vfsops.c,v 1.10 1996/02/09 22:31:28 christos Exp $ */ /* * Copyright (c) 1989, 1990, 1993, 1994 @@ -62,7 +63,7 @@ u_long mfs_rootsize; /* size of mini-root in bytes */ static int mfs_minor; /* used for building internal dev_t */ -extern int (**mfs_vnodeop_p)(); +extern int (**mfs_vnodeop_p) __P((void *)); /* * mfs vfs operations. @@ -89,6 +90,7 @@ struct vfsops mfs_vfsops = { */ #define ROOTNAME "mfs_root" +int mfs_mountroot() { extern struct vnode *rootvp; @@ -119,12 +121,12 @@ mfs_mountroot() mfsp->mfs_vnode = rootvp; mfsp->mfs_pid = p->p_pid; mfsp->mfs_buflist = (struct buf *)0; - if (error = ffs_mountfs(rootvp, mp, p)) { + if ((error = ffs_mountfs(rootvp, mp, p)) != 0) { free(mp, M_MOUNT); free(mfsp, M_MFSNODE); return (error); } - if (error = vfs_lock(mp)) { + if ((error = vfs_lock(mp)) != 0) { (void)ffs_unmount(mp, 0, p); free(mp, M_MOUNT); free(mfsp, M_MFSNODE); @@ -150,11 +152,12 @@ mfs_mountroot() * This is called early in boot to set the base address and size * of the mini-root. */ +int mfs_initminiroot(base) caddr_t base; { struct fs *fs = (struct fs *)(base + SBOFF); - extern int (*mountroot)(); + extern int (*mountroot) __P((void)); /* check for valid super block */ if (fs->fs_magic != FS_MAGIC || fs->fs_bsize > MAXBSIZE || @@ -189,7 +192,8 @@ mfs_mount(mp, path, data, ndp, p) size_t size; int flags, error; - if (error = copyin(data, (caddr_t)&args, sizeof (struct mfs_args))) + error = copyin(data, (caddr_t)&args, sizeof (struct mfs_args)); + if (error) return (error); /* @@ -231,7 +235,7 @@ mfs_mount(mp, path, data, ndp, p) mfsp->mfs_vnode = devvp; mfsp->mfs_pid = p->p_pid; mfsp->mfs_buflist = (struct buf *)0; - if (error = ffs_mountfs(devvp, mp, p)) { + if ((error = ffs_mountfs(devvp, mp, p)) != 0) { mfsp->mfs_buflist = (struct buf *)-1; vrele(devvp); return (error); @@ -273,10 +277,10 @@ mfs_start(mp, flags, p) base = mfsp->mfs_baseoff; while (mfsp->mfs_buflist != (struct buf *)-1) { #define DOIO() \ - while (bp = mfsp->mfs_buflist) { \ - mfsp->mfs_buflist = bp->b_actf; \ - mfs_doio(bp, base); \ - wakeup((caddr_t)bp); \ + while ((bp = mfsp->mfs_buflist) != NULL) { \ + mfsp->mfs_buflist = bp->b_actf; \ + mfs_doio(bp, base); \ + wakeup((caddr_t)bp); \ } DOIO(); /* @@ -285,7 +289,7 @@ mfs_start(mp, flags, p) * otherwise we will loop here, as tsleep will always return * EINTR/ERESTART. */ - if (error = tsleep((caddr_t)vp, mfs_pri, "mfsidl", 0)) { + if ((error = tsleep((caddr_t)vp, mfs_pri, "mfsidl", 0)) != 0) { DOIO(); if (dounmount(mp, 0, p) != 0) CLRSIG(p, CURSIG(p)); @@ -297,6 +301,7 @@ mfs_start(mp, flags, p) /* * Get file system statistics. */ +int mfs_statfs(mp, sbp, p) struct mount *mp; struct statfs *sbp; diff --git a/sys/ufs/mfs/mfs_vnops.c b/sys/ufs/mfs/mfs_vnops.c index 6a71c936e51..eb80b5140c4 100644 --- a/sys/ufs/mfs/mfs_vnops.c +++ b/sys/ufs/mfs/mfs_vnops.c @@ -1,4 +1,5 @@ -/* $NetBSD: mfs_vnops.c,v 1.5 1994/12/14 13:03:52 mycroft Exp $ */ +/* $OpenBSD: mfs_vnops.c,v 1.2 1996/02/27 07:15:48 niklas Exp $ */ +/* $NetBSD: mfs_vnops.c,v 1.6 1996/02/09 22:31:30 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -56,7 +57,7 @@ /* * mfs vnode operations. */ -int (**mfs_vnodeop_p)(); +int (**mfs_vnodeop_p) __P((void *)); struct vnodeopv_entry_desc mfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, mfs_lookup }, /* lookup */ @@ -99,7 +100,7 @@ struct vnodeopv_entry_desc mfs_vnodeop_entries[] = { { &vop_truncate_desc, mfs_truncate }, /* truncate */ { &vop_update_desc, mfs_update }, /* update */ { &vop_bwrite_desc, mfs_bwrite }, /* bwrite */ - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; struct vnodeopv_desc mfs_vnodeop_opv_desc = { &mfs_vnodeop_p, mfs_vnodeop_entries }; @@ -113,14 +114,15 @@ struct vnodeopv_desc mfs_vnodeop_opv_desc = */ /* ARGSUSED */ int -mfs_open(ap) +mfs_open(v) + void *v; +{ struct vop_open_args /* { struct vnode *a_vp; int a_mode; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; if (ap->a_vp->v_type != VBLK) { panic("mfs_ioctl not VBLK"); @@ -134,7 +136,10 @@ mfs_open(ap) */ /* ARGSUSED */ int -mfs_ioctl(ap) +mfs_ioctl(v) + void *v; +{ +#if 0 struct vop_ioctl_args /* { struct vnode *a_vp; u_long a_command; @@ -142,8 +147,8 @@ mfs_ioctl(ap) int a_fflag; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; +#endif return (ENOTTY); } @@ -152,11 +157,12 @@ mfs_ioctl(ap) * Pass I/O requests to the memory filesystem process. */ int -mfs_strategy(ap) +mfs_strategy(v) + void *v; +{ struct vop_strategy_args /* { struct buf *a_bp; - } */ *ap; -{ + } */ *ap = v; register struct buf *bp = ap->a_bp; register struct mfsnode *mfsp; struct vnode *vp; @@ -210,15 +216,16 @@ mfs_doio(bp, base) * This is a noop, simply returning what one has been given. */ int -mfs_bmap(ap) +mfs_bmap(v) + void *v; +{ struct vop_bmap_args /* { struct vnode *a_vp; daddr_t a_bn; struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; - } */ *ap; -{ + } */ *ap = v; if (ap->a_vpp != NULL) *ap->a_vpp = ap->a_vp; @@ -232,14 +239,15 @@ mfs_bmap(ap) */ /* ARGSUSED */ int -mfs_close(ap) +mfs_close(v) + void *v; +{ struct vop_close_args /* { struct vnode *a_vp; int a_fflag; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vp = ap->a_vp; register struct mfsnode *mfsp = VTOMFS(vp); register struct buf *bp; @@ -248,7 +256,7 @@ mfs_close(ap) /* * Finish any pending I/O requests. */ - while (bp = mfsp->mfs_buflist) { + while ((bp = mfsp->mfs_buflist) != NULL) { mfsp->mfs_buflist = bp->b_actf; mfs_doio(bp, mfsp->mfs_baseoff); wakeup((caddr_t)bp); @@ -258,7 +266,7 @@ mfs_close(ap) * we must invalidate any in core blocks, so that * we can, free up its vnode. */ - if (error = vinvalbuf(vp, 1, ap->a_cred, ap->a_p, 0, 0)) + if ((error = vinvalbuf(vp, 1, ap->a_cred, ap->a_p, 0, 0)) != 0) return (error); /* * There should be no way to have any more uses of this @@ -281,11 +289,12 @@ mfs_close(ap) */ /* ARGSUSED */ int -mfs_inactive(ap) +mfs_inactive(v) + void *v; +{ struct vop_inactive_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; register struct mfsnode *mfsp = VTOMFS(ap->a_vp); if (mfsp->mfs_buflist && mfsp->mfs_buflist != (struct buf *)(-1)) @@ -298,11 +307,12 @@ mfs_inactive(ap) * Reclaim a memory filesystem devvp so that it can be reused. */ int -mfs_reclaim(ap) +mfs_reclaim(v) + void *v; +{ struct vop_reclaim_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vp = ap->a_vp; FREE(vp->v_data, M_MFSNODE); @@ -314,15 +324,16 @@ mfs_reclaim(ap) * Print out the contents of an mfsnode. */ int -mfs_print(ap) +mfs_print(v) + void *v; +{ struct vop_print_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; register struct mfsnode *mfsp = VTOMFS(ap->a_vp); printf("tag VT_MFS, pid %d, base %d, size %d\n", mfsp->mfs_pid, - mfsp->mfs_baseoff, mfsp->mfs_size); + (unsigned int) mfsp->mfs_baseoff, mfsp->mfs_size); return (0); } @@ -330,7 +341,8 @@ mfs_print(ap) * Block device bad operation */ int -mfs_badop() +mfs_badop(v) + void *v; { panic("mfs_badop called\n"); @@ -340,6 +352,7 @@ mfs_badop() /* * Memory based filesystem initialization. */ +void mfs_init() { diff --git a/sys/ufs/mfs/mfsnode.h b/sys/ufs/mfs/mfsnode.h index b3238b5860b..2dddd23056f 100644 --- a/sys/ufs/mfs/mfsnode.h +++ b/sys/ufs/mfs/mfsnode.h @@ -1,4 +1,5 @@ -/* $NetBSD: mfsnode.h,v 1.2 1994/06/29 06:47:16 cgd Exp $ */ +/* $OpenBSD: mfsnode.h,v 1.2 1996/02/27 07:15:49 niklas Exp $ */ +/* $NetBSD: mfsnode.h,v 1.3 1996/02/09 22:31:31 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -55,34 +56,34 @@ struct mfsnode { #define MFSTOV(mfsp) ((mfsp)->mfs_vnode) /* Prototypes for MFS operations on vnodes. */ -#define mfs_lookup ((int (*) __P((struct vop_lookup_args *)))mfs_badop) -#define mfs_create ((int (*) __P((struct vop_create_args *)))mfs_badop) -#define mfs_mknod ((int (*) __P((struct vop_mknod_args *)))mfs_badop) -#define mfs_access ((int (*) __P((struct vop_access_args *)))mfs_badop) -#define mfs_getattr ((int (*) __P((struct vop_getattr_args *)))mfs_badop) -#define mfs_setattr ((int (*) __P((struct vop_setattr_args *)))mfs_badop) -#define mfs_read ((int (*) __P((struct vop_read_args *)))mfs_badop) -#define mfs_write ((int (*) __P((struct vop_write_args *)))mfs_badop) -#define mfs_select ((int (*) __P((struct vop_select_args *)))mfs_badop) -#define mfs_mmap ((int (*) __P((struct vop_mmap_args *)))mfs_badop) -#define mfs_seek ((int (*) __P((struct vop_seek_args *)))mfs_badop) -#define mfs_remove ((int (*) __P((struct vop_remove_args *)))mfs_badop) -#define mfs_link ((int (*) __P((struct vop_link_args *)))mfs_badop) -#define mfs_rename ((int (*) __P((struct vop_rename_args *)))mfs_badop) -#define mfs_mkdir ((int (*) __P((struct vop_mkdir_args *)))mfs_badop) -#define mfs_rmdir ((int (*) __P((struct vop_rmdir_args *)))mfs_badop) -#define mfs_symlink ((int (*) __P((struct vop_symlink_args *)))mfs_badop) -#define mfs_readdir ((int (*) __P((struct vop_readdir_args *)))mfs_badop) -#define mfs_readlink ((int (*) __P((struct vop_readlink_args *)))mfs_badop) -#define mfs_abortop ((int (*) __P((struct vop_abortop_args *)))mfs_badop) -#define mfs_lock ((int (*) __P((struct vop_lock_args *)))nullop) -#define mfs_unlock ((int (*) __P((struct vop_unlock_args *)))nullop) -#define mfs_islocked ((int (*) __P((struct vop_islocked_args *)))nullop) -#define mfs_pathconf ((int (*) __P((struct vop_pathconf_args *)))mfs_badop) -#define mfs_advlock ((int (*) __P((struct vop_advlock_args *)))mfs_badop) -#define mfs_blkatoff ((int (*) __P((struct vop_blkatoff_args *)))mfs_badop) -#define mfs_valloc ((int (*) __P((struct vop_valloc_args *)))mfs_badop) -#define mfs_vfree ((int (*) __P((struct vop_vfree_args *)))mfs_badop) -#define mfs_truncate ((int (*) __P((struct vop_truncate_args *)))mfs_badop) -#define mfs_update ((int (*) __P((struct vop_update_args *)))mfs_badop) -#define mfs_bwrite ((int (*) __P((struct vop_bwrite_args *)))vn_bwrite) +#define mfs_lookup mfs_badop +#define mfs_create mfs_badop +#define mfs_mknod mfs_badop +#define mfs_access mfs_badop +#define mfs_getattr mfs_badop +#define mfs_setattr mfs_badop +#define mfs_read mfs_badop +#define mfs_write mfs_badop +#define mfs_select mfs_badop +#define mfs_mmap mfs_badop +#define mfs_seek mfs_badop +#define mfs_remove mfs_badop +#define mfs_link mfs_badop +#define mfs_rename mfs_badop +#define mfs_mkdir mfs_badop +#define mfs_rmdir mfs_badop +#define mfs_symlink mfs_badop +#define mfs_readdir mfs_badop +#define mfs_readlink mfs_badop +#define mfs_abortop mfs_badop +#define mfs_lock nullop +#define mfs_unlock nullop +#define mfs_islocked nullop +#define mfs_pathconf mfs_badop +#define mfs_advlock mfs_badop +#define mfs_blkatoff mfs_badop +#define mfs_valloc mfs_badop +#define mfs_vfree mfs_badop +#define mfs_truncate mfs_badop +#define mfs_update mfs_badop +#define mfs_bwrite vn_bwrite |