diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-27 07:58:05 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-27 07:58:05 +0000 |
commit | 2d0a16954c8b81a168d86159af8f8c888305d4f3 (patch) | |
tree | 5e5f2c6b4f5d18d271ca978aed1a41f8e6b814a6 /sys | |
parent | 8a05be43b162792dfbbfe8ca0aaef2bc3105ebb4 (diff) |
From NetBSD: update to 960217 sources
Diffstat (limited to 'sys')
-rw-r--r-- | sys/miscfs/nullfs/null.h | 8 | ||||
-rw-r--r-- | sys/miscfs/nullfs/null_subr.c | 19 | ||||
-rw-r--r-- | sys/miscfs/nullfs/null_vfsops.c | 25 | ||||
-rw-r--r-- | sys/miscfs/nullfs/null_vnops.c | 82 |
4 files changed, 85 insertions, 49 deletions
diff --git a/sys/miscfs/nullfs/null.h b/sys/miscfs/nullfs/null.h index 27ed4972325..dc35a7edd1a 100644 --- a/sys/miscfs/nullfs/null.h +++ b/sys/miscfs/nullfs/null.h @@ -1,4 +1,5 @@ -/* $NetBSD: null.h,v 1.4 1995/03/29 22:08:24 briggs Exp $ */ +/* $OpenBSD: null.h,v 1.2 1996/02/27 07:58:01 niklas Exp $ */ +/* $NetBSD: null.h,v 1.5 1996/02/09 22:40:26 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -70,6 +71,9 @@ extern struct vnode *null_checkvp __P((struct vnode *vp, char *fil, int lno)); #define NULLVPTOLOWERVP(vp) (VTONULL(vp)->null_lowervp) #endif -extern int (**null_vnodeop_p)(); +extern int (**null_vnodeop_p) __P((void *)); extern struct vfsops null_vfsops; + +void nullfs_init __P((void)); + #endif /* _KERNEL */ diff --git a/sys/miscfs/nullfs/null_subr.c b/sys/miscfs/nullfs/null_subr.c index 05c1987ae72..e83fec300ac 100644 --- a/sys/miscfs/nullfs/null_subr.c +++ b/sys/miscfs/nullfs/null_subr.c @@ -1,4 +1,5 @@ -/* $NetBSD: null_subr.c,v 1.4 1994/09/20 06:43:00 cgd Exp $ */ +/* $OpenBSD: null_subr.c,v 1.2 1996/02/27 07:58:02 niklas Exp $ */ +/* $NetBSD: null_subr.c,v 1.5 1996/02/09 22:40:28 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -66,9 +67,15 @@ LIST_HEAD(null_node_hashhead, null_node) *null_node_hashtbl; u_long null_node_hash; +void nullfs_init __P((void)); +static struct vnode * + null_node_find __P((struct mount *, struct vnode *)); +static int + null_node_alloc __P((struct mount *, struct vnode *, struct vnode **)); /* * Initialise cache headers */ +void nullfs_init() { @@ -133,9 +140,9 @@ null_node_alloc(mp, lowervp, vpp) struct null_node *xp; struct vnode *vp, *nvp; int error; - extern int (**dead_vnodeop_p)(); + extern int (**dead_vnodeop_p) __P((void *)); - if (error = getnewvnode(VT_NULL, mp, null_vnodeop_p, &vp)) + if ((error = getnewvnode(VT_NULL, mp, null_vnodeop_p, &vp)) != 0) return (error); vp->v_type = lowervp->v_type; @@ -155,7 +162,7 @@ null_node_alloc(mp, lowervp, vpp) * check to see if someone else has beaten us to it. * (We could have slept in MALLOC.) */ - if (nvp = null_node_find(lowervp)) { + if ((nvp = null_node_find(mp, lowervp)) != NULL) { *vpp = nvp; /* free the substructures we've allocated. */ @@ -234,7 +241,7 @@ null_node_create(mp, lowervp, newvpp) { struct vnode *aliasvp; - if (aliasvp = null_node_find(mp, lowervp)) { + if ((aliasvp = null_node_find(mp, lowervp)) != NULL) { /* * null_node_find has taken another reference * to the alias vnode. @@ -256,7 +263,7 @@ null_node_create(mp, lowervp, newvpp) /* * Make new vnode reference the null_node. */ - if (error = null_node_alloc(mp, lowervp, &aliasvp)) + if ((error = null_node_alloc(mp, lowervp, &aliasvp)) != 0) return error; /* diff --git a/sys/miscfs/nullfs/null_vfsops.c b/sys/miscfs/nullfs/null_vfsops.c index ac9f63896a1..9b36e636d15 100644 --- a/sys/miscfs/nullfs/null_vfsops.c +++ b/sys/miscfs/nullfs/null_vfsops.c @@ -1,4 +1,5 @@ -/* $NetBSD: null_vfsops.c,v 1.9 1995/06/18 14:47:32 cgd Exp $ */ +/* $OpenBSD: null_vfsops.c,v 1.2 1996/02/27 07:58:03 niklas Exp $ */ +/* $NetBSD: null_vfsops.c,v 1.10 1996/02/09 22:40:31 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -55,6 +56,19 @@ #include <sys/malloc.h> #include <miscfs/nullfs/null.h> +int nullfs_mount __P((struct mount *, char *, caddr_t, + struct nameidata *, struct proc *)); +int nullfs_start __P((struct mount *, int, struct proc *)); +int nullfs_unmount __P((struct mount *, int, struct proc *)); +int nullfs_root __P((struct mount *, struct vnode **)); +int nullfs_quotactl __P((struct mount *, int, uid_t, caddr_t, + struct proc *)); +int nullfs_statfs __P((struct mount *, struct statfs *, struct proc *)); +int nullfs_sync __P((struct mount *, int, struct ucred *, struct proc *)); +int nullfs_vget __P((struct mount *, ino_t, struct vnode **)); +int nullfs_fhtovp __P((struct mount *, struct fid *, struct mbuf *, + struct vnode **, int *, struct ucred **)); +int nullfs_vptofh __P((struct vnode *, struct fid *)); /* * Mount null layer */ @@ -88,7 +102,8 @@ nullfs_mount(mp, path, data, ndp, p) /* * Get argument */ - if (error = copyin(data, (caddr_t)&args, sizeof(struct null_args))) + error = copyin(data, (caddr_t)&args, sizeof(struct null_args)); + if (error) return (error); /* @@ -96,7 +111,7 @@ nullfs_mount(mp, path, data, ndp, p) */ NDINIT(ndp, LOOKUP, FOLLOW|WANTPARENT|LOCKLEAF, UIO_USERSPACE, args.target, p); - if (error = namei(ndp)) + if ((error = namei(ndp)) != 0) return (error); /* @@ -210,7 +225,7 @@ nullfs_unmount(mp, mntflags, p) #endif if (nullm_rootvp->v_usecount > 1) return (EBUSY); - if (error = vflush(mp, nullm_rootvp, flags)) + if ((error = vflush(mp, nullm_rootvp, flags)) != 0) return (error); #ifdef NULLFS_DIAGNOSTIC @@ -355,8 +370,6 @@ nullfs_vptofh(vp, fhp) return (EOPNOTSUPP); } -int nullfs_init __P((void)); - struct vfsops null_vfsops = { MOUNT_NULL, nullfs_mount, diff --git a/sys/miscfs/nullfs/null_vnops.c b/sys/miscfs/nullfs/null_vnops.c index 937ac5a4ae2..2b0b8e79ab9 100644 --- a/sys/miscfs/nullfs/null_vnops.c +++ b/sys/miscfs/nullfs/null_vnops.c @@ -1,4 +1,5 @@ -/* $NetBSD: null_vnops.c,v 1.4 1994/08/19 11:25:37 mycroft Exp $ */ +/* $OpenBSD: null_vnops.c,v 1.2 1996/02/27 07:58:04 niklas Exp $ */ +/* $NetBSD: null_vnops.c,v 1.5 1996/02/09 22:40:34 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -181,6 +182,13 @@ int null_bug_bypass = 0; /* for debugging: enables bypass printf'ing */ +int null_bypass __P((void *)); +int null_getattr __P((void *)); +int null_inactive __P((void *)); +int null_reclaim __P((void *)); +int null_print __P((void *)); +int null_strategy __P((void *)); +int null_bwrite __P((void *)); /* * This is the 10-Apr-92 bypass routine. * This version has been optimized for speed, throwing away some @@ -207,13 +215,13 @@ int null_bug_bypass = 0; /* for debugging: enables bypass printf'ing */ * problems on rmdir'ing mount points and renaming?) */ int -null_bypass(ap) +null_bypass(v) + void *v; +{ struct vop_generic_args /* { struct vnodeop_desc *a_desc; <other random data follows, presumably> - } */ *ap; -{ - extern int (**null_vnodeop_p)(); /* not extern, really "forward" */ + } */ *ap = v; register struct vnode **this_vp_p; int error; struct vnode *old_vps[VDESC_MAX_VPS]; @@ -319,16 +327,17 @@ null_bypass(ap) * We handle getattr only to change the fsid. */ int -null_getattr(ap) +null_getattr(v) + void *v; +{ struct vop_getattr_args /* { struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; int error; - if (error = null_bypass(ap)) + if ((error = null_bypass(ap)) != NULL) return (error); /* Requires that arguments be restored. */ ap->a_vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0]; @@ -337,10 +346,8 @@ null_getattr(ap) int -null_inactive(ap) - struct vop_inactive_args /* { - struct vnode *a_vp; - } */ *ap; +null_inactive(v) + void *v; { /* * Do nothing (and _don't_ bypass). @@ -358,11 +365,12 @@ null_inactive(ap) } int -null_reclaim(ap) +null_reclaim(v) + void *v; +{ struct vop_reclaim_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; struct vnode *vp = ap->a_vp; struct null_node *xp = VTONULL(vp); struct vnode *lowervp = xp->null_lowervp; @@ -382,13 +390,15 @@ null_reclaim(ap) int -null_print(ap) +null_print(v) + void *v; +{ struct vop_print_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vp = ap->a_vp; - printf ("\ttag VT_NULLFS, vp=%x, lowervp=%x\n", vp, NULLVPTOLOWERVP(vp)); + printf ("\ttag VT_NULLFS, vp=%x, lowervp=%x\n", (unsigned int) vp, + (unsigned int) NULLVPTOLOWERVP(vp)); return (0); } @@ -399,11 +409,12 @@ null_print(ap) * This goes away with a merged VM/buffer cache. */ int -null_strategy(ap) +null_strategy(v) + void *v; +{ struct vop_strategy_args /* { struct buf *a_bp; - } */ *ap; -{ + } */ *ap = v; struct buf *bp = ap->a_bp; int error; struct vnode *savedvp; @@ -425,11 +436,12 @@ null_strategy(ap) * This goes away with a merged VM/buffer cache. */ int -null_bwrite(ap) +null_bwrite(v) + void *v; +{ struct vop_bwrite_args /* { struct buf *a_bp; - } */ *ap; -{ + } */ *ap = v; struct buf *bp = ap->a_bp; int error; struct vnode *savedvp; @@ -447,19 +459,19 @@ null_bwrite(ap) /* * Global vfs data structures */ -int (**null_vnodeop_p)(); +int (**null_vnodeop_p) __P((void *)); struct vnodeopv_entry_desc null_vnodeop_entries[] = { - { &vop_default_desc, null_bypass }, + { &vop_default_desc, null_bypass }, - { &vop_getattr_desc, null_getattr }, - { &vop_inactive_desc, null_inactive }, - { &vop_reclaim_desc, null_reclaim }, - { &vop_print_desc, null_print }, + { &vop_getattr_desc, null_getattr }, + { &vop_inactive_desc, null_inactive }, + { &vop_reclaim_desc, null_reclaim }, + { &vop_print_desc, null_print }, - { &vop_strategy_desc, null_strategy }, - { &vop_bwrite_desc, null_bwrite }, + { &vop_strategy_desc, null_strategy }, + { &vop_bwrite_desc, null_bwrite }, - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; struct vnodeopv_desc null_vnodeop_opv_desc = { &null_vnodeop_p, null_vnodeop_entries }; |