diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-27 08:09:04 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-27 08:09:04 +0000 |
commit | cc3168f1451f2932dea676a480d95729d9900183 (patch) | |
tree | 32c98bb3688ab7410d3d97f643ef2f9ab90da2c7 /sys/miscfs/union/union_vfsops.c | |
parent | 08747189dfbfeed5008511fba7bd5f54eabd6b9a (diff) |
From NetBSD: update to 960217 sources
Diffstat (limited to 'sys/miscfs/union/union_vfsops.c')
-rw-r--r-- | sys/miscfs/union/union_vfsops.c | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/sys/miscfs/union/union_vfsops.c b/sys/miscfs/union/union_vfsops.c index f85b9c0d4fc..654d6ba0acc 100644 --- a/sys/miscfs/union/union_vfsops.c +++ b/sys/miscfs/union/union_vfsops.c @@ -1,3 +1,4 @@ +/* $OpenBSD: union_vfsops.c,v 1.2 1996/02/27 08:09:02 niklas Exp $ */ /* $NetBSD: union_vfsops.c,v 1.10 1995/06/18 14:47:47 cgd Exp $ */ /* @@ -56,6 +57,19 @@ #include <sys/queue.h> #include <miscfs/union/union.h> +int union_mount __P((struct mount *, char *, caddr_t, struct nameidata *, + struct proc *)); +int union_start __P((struct mount *, int, struct proc *)); +int union_unmount __P((struct mount *, int, struct proc *)); +int union_root __P((struct mount *, struct vnode **)); +int union_quotactl __P((struct mount *, int, uid_t, caddr_t, struct proc *)); +int union_statfs __P((struct mount *, struct statfs *, struct proc *)); +int union_sync __P((struct mount *, int, struct ucred *, struct proc *)); +int union_vget __P((struct mount *, ino_t, struct vnode **)); +int union_fhtovp __P((struct mount *, struct fid *, struct mbuf *, + struct vnode **, int *, struct ucred **)); +int union_vptofh __P((struct vnode *, struct fid *)); + /* * Mount union filesystem */ @@ -73,8 +87,6 @@ union_mount(mp, path, data, ndp, p) struct vnode *upperrootvp = NULLVP; struct union_mount *um = 0; struct ucred *cred = 0; - struct ucred *scred; - struct vattr va; char *cp; int len; size_t size; @@ -99,7 +111,8 @@ union_mount(mp, path, data, ndp, p) /* * Get argument */ - if (error = copyin(data, (caddr_t)&args, sizeof(struct union_args))) + error = copyin(data, (caddr_t)&args, sizeof(struct union_args)); + if (error) goto bad; lowerrootvp = mp->mnt_vnodecovered; @@ -111,7 +124,7 @@ union_mount(mp, path, data, ndp, p) NDINIT(ndp, LOOKUP, FOLLOW|WANTPARENT, UIO_USERSPACE, args.target, p); - if (error = namei(ndp)) + if ((error = namei(ndp)) != 0) goto bad; upperrootvp = ndp->ni_vp; @@ -214,6 +227,12 @@ union_mount(mp, path, data, ndp, p) case UNMNT_REPLACE: cp = ""; break; + default: + cp = "<invalid>:"; +#ifdef DIAGNOSTIC + panic("union_mount: bad um_op"); +#endif + break; } len = strlen(cp); bcopy(cp, mp->mnt_stat.f_mntfromname, len); @@ -247,6 +266,7 @@ bad: * on the underlying filesystem(s) will have been called * when that filesystem was mounted. */ + /*ARGSUSED*/ int union_start(mp, flags, p) struct mount *mp; @@ -284,7 +304,7 @@ union_unmount(mp, mntflags, p) flags |= FORCECLOSE; } - if (error = union_root(mp, &um_rootvp)) + if ((error = union_root(mp, &um_rootvp)) != 0) return (error); /* @@ -390,6 +410,7 @@ union_root(mp, vpp) return (error); } +/*ARGSUSED*/ int union_quotactl(mp, cmd, uid, arg, p) struct mount *mp; @@ -476,6 +497,7 @@ union_statfs(mp, sbp, p) return (0); } +/*ARGSUSED*/ int union_sync(mp, waitfor, cred, p) struct mount *mp; @@ -490,6 +512,7 @@ union_sync(mp, waitfor, cred, p) return (0); } +/*ARGSUSED*/ int union_vget(mp, ino, vpp) struct mount *mp; @@ -500,6 +523,7 @@ union_vget(mp, ino, vpp) return (EOPNOTSUPP); } +/*ARGSUSED*/ int union_fhtovp(mp, fidp, nam, vpp, exflagsp, credanonp) struct mount *mp; @@ -513,6 +537,7 @@ union_fhtovp(mp, fidp, nam, vpp, exflagsp, credanonp) return (EOPNOTSUPP); } +/*ARGSUSED*/ int union_vptofh(vp, fhp) struct vnode *vp; @@ -522,8 +547,6 @@ union_vptofh(vp, fhp) return (EOPNOTSUPP); } -int union_init __P((void)); - struct vfsops union_vfsops = { MOUNT_UNION, union_mount, |