Cosmetics. reduce the noise from gcc -Wall.

This commit is contained in:
Poul-Henning Kamp 1994-10-10 07:55:48 +00:00
parent 76d121f2b4
commit 3a773ad0b5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3496
26 changed files with 200 additions and 136 deletions

View file

@ -36,7 +36,7 @@
* @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94
*
* @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92
* $Id: null_vfsops.c,v 1.2 1994/09/21 03:47:01 wollman Exp $
* $Id: null_vfsops.c,v 1.3 1994/09/22 19:38:14 wollman Exp $
*/
/*
@ -88,7 +88,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 +97,8 @@ nullfs_mount(mp, path, data, ndp, p)
*/
NDINIT(ndp, LOOKUP, FOLLOW|WANTPARENT|LOCKLEAF,
UIO_USERSPACE, args.target, p);
if (error = namei(ndp))
error = namei(ndp);
if (error)
return (error);
/*
@ -209,7 +211,8 @@ nullfs_unmount(mp, mntflags, p)
#endif
if (nullm_rootvp->v_usecount > 1)
return (EBUSY);
if (error = vflush(mp, nullm_rootvp, flags))
error = vflush(mp, nullm_rootvp, flags);
if (error)
return (error);
#ifdef NULLFS_DIAGNOSTIC

View file

@ -35,7 +35,7 @@
*
* @(#)null_vnops.c 8.1 (Berkeley) 6/10/93
*
* $Id: null_vnops.c,v 1.4 1994/09/21 03:47:02 wollman Exp $
* $Id: null_vnops.c,v 1.5 1994/09/21 23:22:41 wollman Exp $
*/
/*
@ -321,7 +321,8 @@ null_getattr(ap)
} */ *ap;
{
int error;
if (error = null_bypass(ap))
error = null_bypass(ap);
if (error)
return (error);
/* Requires that arguments be restored. */
ap->a_vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0];
@ -381,7 +382,7 @@ null_print(ap)
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
printf ("\ttag VT_NULLFS, vp=%x, lowervp=%x\n", vp, NULLVPTOLOWERVP(vp));
printf ("\ttag VT_NULLFS, vp=%p, lowervp=%p\n", vp, NULLVPTOLOWERVP(vp));
return (0);
}

View file

@ -35,7 +35,7 @@
*
* @(#)portal_vfsops.c 8.6 (Berkeley) 1/21/94
*
* $Id: portal_vfsops.c,v 1.3 1994/09/22 19:38:17 wollman Exp $
* $Id: portal_vfsops.c,v 1.4 1994/09/23 11:01:58 davidg Exp $
*/
/*
@ -94,10 +94,12 @@ portal_mount(mp, path, data, ndp, p)
if (mp->mnt_flag & MNT_UPDATE)
return (EOPNOTSUPP);
if (error = copyin(data, (caddr_t) &args, sizeof(struct portal_args)))
error = copyin(data, (caddr_t) &args, sizeof(struct portal_args));
if (error)
return (error);
if (error = getsock(p->p_fd, args.pa_socket, &fp))
error = getsock(p->p_fd, args.pa_socket, &fp);
if (error)
return (error);
so = (struct socket *) fp->f_data;
if (so->so_proto->pr_domain->dom_family != AF_UNIX)
@ -177,7 +179,8 @@ portal_unmount(mp, mntflags, p)
#endif
if (rootvp->v_usecount > 1)
return (EBUSY);
if (error = vflush(mp, rootvp, flags))
error = vflush(mp, rootvp, flags);
if (error)
return (error);
/*

View file

@ -36,7 +36,7 @@
*
* @(#)procfs_status.c 8.3 (Berkeley) 2/17/94
*
* $Id: procfs_status.c,v 1.1.1.1 1994/05/24 10:05:08 rgrimes Exp $
* $Id: procfs_status.c,v 1.2 1994/08/02 07:45:20 davidg Exp $
*/
#include <sys/param.h>
@ -104,7 +104,7 @@ procfs_dostatus(curp, p, pfs, uio)
ps += sprintf(ps, "noflags");
if (p->p_flag & P_INMEM)
ps += sprintf(ps, " %d,%d",
ps += sprintf(ps, " %ld,%ld",
p->p_stats->p_start.tv_sec,
p->p_stats->p_start.tv_usec);
else
@ -114,7 +114,7 @@ procfs_dostatus(curp, p, pfs, uio)
struct timeval ut, st;
calcru(p, &ut, &st, (void *) 0);
ps += sprintf(ps, " %d,%d %d,%d",
ps += sprintf(ps, " %ld,%ld %ld,%ld",
ut.tv_sec,
ut.tv_usec,
st.tv_sec,
@ -126,9 +126,9 @@ procfs_dostatus(curp, p, pfs, uio)
cr = p->p_ucred;
ps += sprintf(ps, " %d", cr->cr_uid, cr->cr_gid);
ps += sprintf(ps, " %ld %ld", cr->cr_uid, cr->cr_gid);
for (i = 0; i < cr->cr_ngroups; i++)
ps += sprintf(ps, ",%d", cr->cr_groups[i]);
ps += sprintf(ps, ",%ld", cr->cr_groups[i]);
ps += sprintf(ps, "\n");
xlen = ps - psbuf;

View file

@ -36,7 +36,7 @@
*
* @(#)procfs_vfsops.c 8.4 (Berkeley) 1/21/94
*
* $Id: procfs_vfsops.c,v 1.4 1994/08/18 22:35:14 wollman Exp $
* $Id: procfs_vfsops.c,v 1.5 1994/09/21 03:47:06 wollman Exp $
*/
/*
@ -114,7 +114,8 @@ procfs_unmount(mp, mntflags, p)
flags |= FORCECLOSE;
}
if (error = vflush(mp, 0, flags))
error = vflush(mp, 0, flags);
if (error)
return (error);
return (0);

View file

@ -36,7 +36,7 @@
*
* @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94
*
* $Id: procfs_vnops.c,v 1.5 1994/09/21 03:47:07 wollman Exp $
* $Id: procfs_vnops.c,v 1.6 1994/09/24 17:01:05 davidg Exp $
*/
/*
@ -114,8 +114,8 @@ procfs_open(ap)
if (PFIND(pfs->pfs_pid) == 0)
return (ENOENT); /* was ESRCH, jsp */
if ((pfs->pfs_flags & FWRITE) && (ap->a_mode & O_EXCL) ||
(pfs->pfs_flags & O_EXCL) && (ap->a_mode & FWRITE))
if (((pfs->pfs_flags & FWRITE) && (ap->a_mode & O_EXCL)) ||
((pfs->pfs_flags & O_EXCL) && (ap->a_mode & FWRITE)))
return (EBUSY);
@ -149,6 +149,8 @@ procfs_close(ap)
if ((ap->a_fflag & FWRITE) && (pfs->pfs_flags & O_EXCL))
pfs->pfs_flags &= ~(FWRITE|O_EXCL);
break;
default:
break;
}
return (0);
@ -281,8 +283,8 @@ procfs_print(ap)
{
struct pfsnode *pfs = VTOPFS(ap->a_vp);
printf("tag VT_PROCFS, pid %d, mode %x, flags %x\n",
pfs->pfs_pid,
printf("tag VT_PROCFS, pid %lu, mode %x, flags %x\n",
(u_long)pfs->pfs_pid,
pfs->pfs_mode, pfs->pfs_flags);
return (0);
}
@ -370,6 +372,8 @@ procfs_getattr(ap)
((VREAD|VWRITE)>>3)|
((VREAD|VWRITE)>>6));
break;
default:
break;
}
/*
@ -488,7 +492,8 @@ procfs_access(ap)
if (ap->a_cred->cr_uid == (uid_t) 0)
return (0);
vap = &vattr;
if (error = VOP_GETATTR(ap->a_vp, vap, ap->a_cred, ap->a_p))
error = VOP_GETATTR(ap->a_vp, vap, ap->a_cred, ap->a_p);
if (error)
return (error);
/*

View file

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94
* $Id: spec_vnops.c,v 1.5 1994/09/21 03:47:09 wollman Exp $
* $Id: spec_vnops.c,v 1.6 1994/10/06 21:06:46 davidg Exp $
*/
#include <sys/param.h>
@ -196,9 +196,12 @@ spec_open(ap)
* Do not allow opens of block devices that are
* currently mounted.
*/
if (error = vfs_mountedon(vp))
error = vfs_mountedon(vp);
if (error)
return (error);
return ((*bdevsw[maj].d_open)(dev, ap->a_mode, S_IFBLK, ap->a_p));
default:
break;
}
return (0);
}
@ -589,7 +592,8 @@ spec_close(ap)
* we must invalidate any in core blocks, so that
* we can, for instance, change floppy disks.
*/
if (error = vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_p, 0, 0))
error = vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_p, 0, 0);
if (error)
return (error);
/*
* We do not want to really close the device if it

View file

@ -35,7 +35,7 @@
*
* @(#)umap_subr.c 8.6 (Berkeley) 1/26/94
*
* $Id: lofs_subr.c, v 1.11 1992/05/30 10:05:43 jsp Exp jsp $
* $Id: umap_subr.c,v 1.2 1994/05/25 09:09:07 rgrimes Exp $
*/
#include <sys/param.h>
@ -212,7 +212,8 @@ umap_node_alloc(mp, lowervp, vpp)
struct vnode *othervp, *vp;
int error;
if (error = getnewvnode(VT_UMAP, mp, umap_vnodeop_p, vpp))
error = getnewvnode(VT_UMAP, mp, umap_vnodeop_p, vpp);
if (error)
return (error);
vp = *vpp;
@ -227,7 +228,8 @@ umap_node_alloc(mp, lowervp, vpp)
* check to see if someone else has beaten us to it.
* (We could have slept in MALLOC.)
*/
if (othervp = umap_node_find(lowervp)) {
othervp = umap_node_find(lowervp);
if (othervp) {
FREE(xp, M_TEMP);
vp->v_type = VBAD; /* node is discarded */
vp->v_usecount = 0; /* XXX */
@ -254,7 +256,8 @@ umap_node_create(mp, targetvp, newvpp)
{
struct vnode *aliasvp;
if (aliasvp = umap_node_find(mp, targetvp)) {
aliasvp = umap_node_find(mp, targetvp);
if (aliasvp) {
/*
* Take another reference to the alias vnode
*/
@ -274,7 +277,8 @@ umap_node_create(mp, targetvp, newvpp)
/*
* Make new vnode reference the umap_node.
*/
if (error = umap_node_alloc(mp, targetvp, &aliasvp))
error = umap_node_alloc(mp, targetvp, &aliasvp);
if (error)
return (error);
/*

View file

@ -35,7 +35,7 @@
*
* @(#)umap_vfsops.c 8.3 (Berkeley) 1/21/94
*
* $Id: umap_vfsops.c,v 1.3 1994/09/21 03:47:11 wollman Exp $
* $Id: umap_vfsops.c,v 1.4 1994/09/22 19:38:19 wollman Exp $
*/
/*
@ -87,7 +87,8 @@ umapfs_mount(mp, path, data, ndp, p)
/*
* Get argument
*/
if (error = copyin(data, (caddr_t)&args, sizeof(struct umap_args)))
error = copyin(data, (caddr_t)&args, sizeof(struct umap_args));
if (error)
return (error);
/*
@ -95,7 +96,8 @@ umapfs_mount(mp, path, data, ndp, p)
*/
NDINIT(ndp, LOOKUP, FOLLOW|WANTPARENT|LOCKLEAF,
UIO_USERSPACE, args.target, p);
if (error = namei(ndp))
error = namei(ndp);
if (error)
return (error);
/*
@ -250,7 +252,8 @@ umapfs_unmount(mp, mntflags, p)
#endif
if (umapm_rootvp->v_usecount > 1)
return (EBUSY);
if (error = vflush(mp, umapm_rootvp, flags))
error = vflush(mp, umapm_rootvp, flags);
if (error)
return (error);
#ifdef UMAPFS_DIAGNOSTIC

View file

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)umap_vnops.c 8.3 (Berkeley) 1/5/94
* $Id: umap_vnops.c,v 1.5 1994/09/21 03:47:12 wollman Exp $
* $Id: umap_vnops.c,v 1.6 1994/09/21 23:22:43 wollman Exp $
*/
/*
@ -141,7 +141,7 @@ umap_bypass(ap)
credp = *credpp;
if (umap_bug_bypass && credp->cr_uid != 0)
printf("umap_bypass: user was %d, group %d\n",
printf("umap_bypass: user was %ld, group %ld\n",
credp->cr_uid, credp->cr_gid);
/* Map all ids in the credential structure. */
@ -149,7 +149,7 @@ umap_bypass(ap)
umap_mapids(vp1->v_mount, credp);
if (umap_bug_bypass && credp->cr_uid != 0)
printf("umap_bypass: user now %d, group %d\n",
printf("umap_bypass: user now %ld, group %ld\n",
credp->cr_uid, credp->cr_gid);
}
@ -167,7 +167,7 @@ umap_bypass(ap)
compcredp = (*compnamepp)->cn_cred = crdup(savecompcredp);
if (umap_bug_bypass && compcredp->cr_uid != 0)
printf("umap_bypass: component credit user was %d, group %d\n",
printf("umap_bypass: component credit user was %ld, group %ld\n",
compcredp->cr_uid, compcredp->cr_gid);
/* Map all ids in the credential structure. */
@ -175,7 +175,7 @@ umap_bypass(ap)
umap_mapids(vp1->v_mount, compcredp);
if (umap_bug_bypass && compcredp->cr_uid != 0)
printf("umap_bypass: component credit user now %d, group %d\n",
printf("umap_bypass: component credit user now %ld, group %ld\n",
compcredp->cr_uid, compcredp->cr_gid);
}
@ -222,25 +222,25 @@ umap_bypass(ap)
*/
if (descp->vdesc_cred_offset != VDESC_NO_OFFSET) {
if (umap_bug_bypass && credp && credp->cr_uid != 0)
printf("umap_bypass: returning-user was %d\n",
printf("umap_bypass: returning-user was %ld\n",
credp->cr_uid);
crfree(credp);
(*credpp) = savecredp;
if (umap_bug_bypass && credpp && (*credpp)->cr_uid != 0)
printf("umap_bypass: returning-user now %d\n\n",
printf("umap_bypass: returning-user now %ld\n\n",
(*credpp)->cr_uid);
}
if (descp->vdesc_componentname_offset != VDESC_NO_OFFSET) {
if (umap_bug_bypass && compcredp && compcredp->cr_uid != 0)
printf("umap_bypass: returning-component-user was %d\n",
printf("umap_bypass: returning-component-user was %ld\n",
compcredp->cr_uid);
crfree(compcredp);
(*compnamepp)->cn_cred = savecompcredp;
if (umap_bug_bypass && credpp && (*credpp)->cr_uid != 0)
printf("umap_bypass: returning-component-user now %d\n",
printf("umap_bypass: returning-component-user now %ld\n",
compcredp->cr_uid);
}
@ -266,7 +266,8 @@ umap_getattr(ap)
struct vnode **vp1p;
struct vnodeop_desc *descp = ap->a_desc;
if (error = umap_bypass(ap))
error = umap_bypass(ap);
if (error)
return (error);
/* Requires that arguments be restored. */
ap->a_vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0];
@ -407,7 +408,7 @@ umap_print(ap)
} */ *ap;
{
struct vnode *vp = ap->a_vp;
printf("\ttag VT_UMAPFS, vp=%x, lowervp=%x\n", vp, UMAPVPTOLOWERVP(vp));
printf("\ttag VT_UMAPFS, vp=%p, lowervp=%p\n", vp, UMAPVPTOLOWERVP(vp));
return (0);
}
@ -441,7 +442,7 @@ umap_rename(ap)
compcredp = compnamep->cn_cred = crdup(savecompcredp);
if (umap_bug_bypass && compcredp->cr_uid != 0)
printf("umap_rename: rename component credit user was %d, group %d\n",
printf("umap_rename: rename component credit user was %ld, group %ld\n",
compcredp->cr_uid, compcredp->cr_gid);
/* Map all ids in the credential structure. */
@ -449,7 +450,7 @@ umap_rename(ap)
umap_mapids(vp->v_mount, compcredp);
if (umap_bug_bypass && compcredp->cr_uid != 0)
printf("umap_rename: rename component credit user now %d, group %d\n",
printf("umap_rename: rename component credit user now %ld, group %ld\n",
compcredp->cr_uid, compcredp->cr_gid);
error = umap_bypass(ap);

View file

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_subr.c 8.4 (Berkeley) 2/17/94
* $Id: union_subr.c,v 1.3 1994/08/02 07:45:44 davidg Exp $
* $Id: union_subr.c,v 1.4 1994/10/06 21:06:48 davidg Exp $
*/
#include <sys/param.h>
@ -224,7 +224,6 @@ union_allocvp(vpp, mp, undvp, dvp, cnp, uppervp, lowervp)
{
int error;
struct union_node *un = 0;
struct union_node **pp;
struct vnode *xlowervp = NULLVP;
int hash = 0;
int try;
@ -594,7 +593,8 @@ union_mkshadow(um, dvp, cnp, vpp)
cn.cn_consume = cnp->cn_consume;
VREF(dvp);
if (error = relookup(dvp, vpp, &cn))
error = relookup(dvp, vpp, &cn);
if (error)
return (error);
vrele(dvp);
@ -638,7 +638,6 @@ union_vn_create(vpp, un, p)
int fmode = FFLAGS(O_WRONLY|O_CREAT|O_TRUNC|O_EXCL);
int error;
int cmode = UN_FILEMODE & ~p->p_fd->fd_cmask;
char *cp;
struct componentname cn;
*vpp = NULLVP;
@ -664,7 +663,8 @@ union_vn_create(vpp, un, p)
cn.cn_consume = 0;
VREF(un->un_dirvp);
if (error = relookup(un->un_dirvp, &vp, &cn))
error = relookup(un->un_dirvp, &vp, &cn);
if (error)
return (error);
vrele(un->un_dirvp);
@ -692,10 +692,12 @@ union_vn_create(vpp, un, p)
vap->va_type = VREG;
vap->va_mode = cmode;
LEASE_CHECK(un->un_dirvp, p, cred, LEASE_WRITE);
if (error = VOP_CREATE(un->un_dirvp, &vp, &cn, vap))
error = VOP_CREATE(un->un_dirvp, &vp, &cn, vap);
if (error)
return (error);
if (error = VOP_OPEN(vp, fmode, cred, p)) {
error = VOP_OPEN(vp, fmode, cred, p);
if (error) {
vput(vp);
return (error);
}

View file

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_vfsops.c 8.7 (Berkeley) 3/5/94
* $Id: union_vfsops.c,v 1.4 1994/09/21 03:47:13 wollman Exp $
* $Id: union_vfsops.c,v 1.5 1994/09/22 19:38:20 wollman Exp $
*/
/*
@ -127,7 +127,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;
@ -147,7 +148,8 @@ union_mount(mp, path, data, ndp, p)
UIO_USERSPACE, args.target, p);
p->p_ucred = scred;
if (error = namei(ndp))
error = namei(ndp);
if (error)
goto bad;
upperrootvp = ndp->ni_vp;
@ -317,13 +319,15 @@ union_unmount(mp, mntflags, p)
flags |= FORCECLOSE;
}
if (error = union_root(mp, &um_rootvp))
error = union_root(mp, &um_rootvp);
if (error)
return (error);
if (um_rootvp->v_usecount > 1) {
vput(um_rootvp);
return (EBUSY);
}
if (error = vflush(mp, um_rootvp, flags)) {
error = vflush(mp, um_rootvp, flags);
if (error) {
vput(um_rootvp);
return (error);
}

View file

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_vnops.c 8.6 (Berkeley) 2/17/94
* $Id: union_vnops.c,v 1.5 1994/09/21 23:22:45 wollman Exp $
* $Id: union_vnops.c,v 1.6 1994/10/06 21:06:49 davidg Exp $
*/
#include <sys/param.h>
@ -132,7 +132,8 @@ union_lookup1(udvp, dvp, vpp, cnp)
continue;
}
if (error = VFS_ROOT(mp, &tdvp)) {
error = VFS_ROOT(mp, &tdvp);
if (error) {
vput(dvp);
return (error);
}
@ -162,7 +163,6 @@ union_lookup(ap)
struct union_node *dun = VTOUNION(dvp);
struct componentname *cnp = ap->a_cnp;
int lockparent = cnp->cn_flags & LOCKPARENT;
int rdonly = cnp->cn_flags & RDONLY;
struct union_mount *um = MOUNTTOUNIONMOUNT(dvp->v_mount);
struct ucred *saved_cred = 0;
@ -574,12 +574,14 @@ union_access(ap)
int error = EACCES;
struct vnode *vp;
if (vp = un->un_uppervp) {
vp = un->un_uppervp;
if (vp) {
FIXUP(un);
return (VOP_ACCESS(vp, ap->a_mode, ap->a_cred, ap->a_p));
}
if (vp = un->un_lowervp) {
vp = un->un_lowervp;
if (vp) {
VOP_LOCK(vp);
error = VOP_ACCESS(vp, ap->a_mode, ap->a_cred, ap->a_p);
if (error == 0) {
@ -1109,7 +1111,6 @@ union_symlink(ap)
if (dvp) {
int error;
struct vnode *vp;
struct mount *mp = ap->a_dvp->v_mount;
FIXUP(un);
VREF(dvp);
@ -1357,7 +1358,7 @@ union_print(ap)
{
struct vnode *vp = ap->a_vp;
printf("\ttag VT_UNION, vp=%x, uppervp=%x, lowervp=%x\n",
printf("\ttag VT_UNION, vp=%p, uppervp=%p, lowervp=%p\n",
vp, UPPERVP(vp), LOWERVP(vp));
return (0);
}

View file

@ -36,7 +36,7 @@
* @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94
*
* @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92
* $Id: null_vfsops.c,v 1.2 1994/09/21 03:47:01 wollman Exp $
* $Id: null_vfsops.c,v 1.3 1994/09/22 19:38:14 wollman Exp $
*/
/*
@ -88,7 +88,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 +97,8 @@ nullfs_mount(mp, path, data, ndp, p)
*/
NDINIT(ndp, LOOKUP, FOLLOW|WANTPARENT|LOCKLEAF,
UIO_USERSPACE, args.target, p);
if (error = namei(ndp))
error = namei(ndp);
if (error)
return (error);
/*
@ -209,7 +211,8 @@ nullfs_unmount(mp, mntflags, p)
#endif
if (nullm_rootvp->v_usecount > 1)
return (EBUSY);
if (error = vflush(mp, nullm_rootvp, flags))
error = vflush(mp, nullm_rootvp, flags);
if (error)
return (error);
#ifdef NULLFS_DIAGNOSTIC

View file

@ -35,7 +35,7 @@
*
* @(#)null_vnops.c 8.1 (Berkeley) 6/10/93
*
* $Id: null_vnops.c,v 1.4 1994/09/21 03:47:02 wollman Exp $
* $Id: null_vnops.c,v 1.5 1994/09/21 23:22:41 wollman Exp $
*/
/*
@ -321,7 +321,8 @@ null_getattr(ap)
} */ *ap;
{
int error;
if (error = null_bypass(ap))
error = null_bypass(ap);
if (error)
return (error);
/* Requires that arguments be restored. */
ap->a_vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0];
@ -381,7 +382,7 @@ null_print(ap)
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
printf ("\ttag VT_NULLFS, vp=%x, lowervp=%x\n", vp, NULLVPTOLOWERVP(vp));
printf ("\ttag VT_NULLFS, vp=%p, lowervp=%p\n", vp, NULLVPTOLOWERVP(vp));
return (0);
}

View file

@ -35,7 +35,7 @@
*
* @(#)portal_vfsops.c 8.6 (Berkeley) 1/21/94
*
* $Id: portal_vfsops.c,v 1.3 1994/09/22 19:38:17 wollman Exp $
* $Id: portal_vfsops.c,v 1.4 1994/09/23 11:01:58 davidg Exp $
*/
/*
@ -94,10 +94,12 @@ portal_mount(mp, path, data, ndp, p)
if (mp->mnt_flag & MNT_UPDATE)
return (EOPNOTSUPP);
if (error = copyin(data, (caddr_t) &args, sizeof(struct portal_args)))
error = copyin(data, (caddr_t) &args, sizeof(struct portal_args));
if (error)
return (error);
if (error = getsock(p->p_fd, args.pa_socket, &fp))
error = getsock(p->p_fd, args.pa_socket, &fp);
if (error)
return (error);
so = (struct socket *) fp->f_data;
if (so->so_proto->pr_domain->dom_family != AF_UNIX)
@ -177,7 +179,8 @@ portal_unmount(mp, mntflags, p)
#endif
if (rootvp->v_usecount > 1)
return (EBUSY);
if (error = vflush(mp, rootvp, flags))
error = vflush(mp, rootvp, flags);
if (error)
return (error);
/*

View file

@ -36,7 +36,7 @@
*
* @(#)procfs_status.c 8.3 (Berkeley) 2/17/94
*
* $Id: procfs_status.c,v 1.1.1.1 1994/05/24 10:05:08 rgrimes Exp $
* $Id: procfs_status.c,v 1.2 1994/08/02 07:45:20 davidg Exp $
*/
#include <sys/param.h>
@ -104,7 +104,7 @@ procfs_dostatus(curp, p, pfs, uio)
ps += sprintf(ps, "noflags");
if (p->p_flag & P_INMEM)
ps += sprintf(ps, " %d,%d",
ps += sprintf(ps, " %ld,%ld",
p->p_stats->p_start.tv_sec,
p->p_stats->p_start.tv_usec);
else
@ -114,7 +114,7 @@ procfs_dostatus(curp, p, pfs, uio)
struct timeval ut, st;
calcru(p, &ut, &st, (void *) 0);
ps += sprintf(ps, " %d,%d %d,%d",
ps += sprintf(ps, " %ld,%ld %ld,%ld",
ut.tv_sec,
ut.tv_usec,
st.tv_sec,
@ -126,9 +126,9 @@ procfs_dostatus(curp, p, pfs, uio)
cr = p->p_ucred;
ps += sprintf(ps, " %d", cr->cr_uid, cr->cr_gid);
ps += sprintf(ps, " %ld %ld", cr->cr_uid, cr->cr_gid);
for (i = 0; i < cr->cr_ngroups; i++)
ps += sprintf(ps, ",%d", cr->cr_groups[i]);
ps += sprintf(ps, ",%ld", cr->cr_groups[i]);
ps += sprintf(ps, "\n");
xlen = ps - psbuf;

View file

@ -36,7 +36,7 @@
*
* @(#)procfs_vfsops.c 8.4 (Berkeley) 1/21/94
*
* $Id: procfs_vfsops.c,v 1.4 1994/08/18 22:35:14 wollman Exp $
* $Id: procfs_vfsops.c,v 1.5 1994/09/21 03:47:06 wollman Exp $
*/
/*
@ -114,7 +114,8 @@ procfs_unmount(mp, mntflags, p)
flags |= FORCECLOSE;
}
if (error = vflush(mp, 0, flags))
error = vflush(mp, 0, flags);
if (error)
return (error);
return (0);

View file

@ -36,7 +36,7 @@
*
* @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94
*
* $Id: procfs_vnops.c,v 1.5 1994/09/21 03:47:07 wollman Exp $
* $Id: procfs_vnops.c,v 1.6 1994/09/24 17:01:05 davidg Exp $
*/
/*
@ -114,8 +114,8 @@ procfs_open(ap)
if (PFIND(pfs->pfs_pid) == 0)
return (ENOENT); /* was ESRCH, jsp */
if ((pfs->pfs_flags & FWRITE) && (ap->a_mode & O_EXCL) ||
(pfs->pfs_flags & O_EXCL) && (ap->a_mode & FWRITE))
if (((pfs->pfs_flags & FWRITE) && (ap->a_mode & O_EXCL)) ||
((pfs->pfs_flags & O_EXCL) && (ap->a_mode & FWRITE)))
return (EBUSY);
@ -149,6 +149,8 @@ procfs_close(ap)
if ((ap->a_fflag & FWRITE) && (pfs->pfs_flags & O_EXCL))
pfs->pfs_flags &= ~(FWRITE|O_EXCL);
break;
default:
break;
}
return (0);
@ -281,8 +283,8 @@ procfs_print(ap)
{
struct pfsnode *pfs = VTOPFS(ap->a_vp);
printf("tag VT_PROCFS, pid %d, mode %x, flags %x\n",
pfs->pfs_pid,
printf("tag VT_PROCFS, pid %lu, mode %x, flags %x\n",
(u_long)pfs->pfs_pid,
pfs->pfs_mode, pfs->pfs_flags);
return (0);
}
@ -370,6 +372,8 @@ procfs_getattr(ap)
((VREAD|VWRITE)>>3)|
((VREAD|VWRITE)>>6));
break;
default:
break;
}
/*
@ -488,7 +492,8 @@ procfs_access(ap)
if (ap->a_cred->cr_uid == (uid_t) 0)
return (0);
vap = &vattr;
if (error = VOP_GETATTR(ap->a_vp, vap, ap->a_cred, ap->a_p))
error = VOP_GETATTR(ap->a_vp, vap, ap->a_cred, ap->a_p);
if (error)
return (error);
/*

View file

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94
* $Id: spec_vnops.c,v 1.5 1994/09/21 03:47:09 wollman Exp $
* $Id: spec_vnops.c,v 1.6 1994/10/06 21:06:46 davidg Exp $
*/
#include <sys/param.h>
@ -196,9 +196,12 @@ spec_open(ap)
* Do not allow opens of block devices that are
* currently mounted.
*/
if (error = vfs_mountedon(vp))
error = vfs_mountedon(vp);
if (error)
return (error);
return ((*bdevsw[maj].d_open)(dev, ap->a_mode, S_IFBLK, ap->a_p));
default:
break;
}
return (0);
}
@ -589,7 +592,8 @@ spec_close(ap)
* we must invalidate any in core blocks, so that
* we can, for instance, change floppy disks.
*/
if (error = vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_p, 0, 0))
error = vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_p, 0, 0);
if (error)
return (error);
/*
* We do not want to really close the device if it

View file

@ -35,7 +35,7 @@
*
* @(#)umap_subr.c 8.6 (Berkeley) 1/26/94
*
* $Id: lofs_subr.c, v 1.11 1992/05/30 10:05:43 jsp Exp jsp $
* $Id: umap_subr.c,v 1.2 1994/05/25 09:09:07 rgrimes Exp $
*/
#include <sys/param.h>
@ -212,7 +212,8 @@ umap_node_alloc(mp, lowervp, vpp)
struct vnode *othervp, *vp;
int error;
if (error = getnewvnode(VT_UMAP, mp, umap_vnodeop_p, vpp))
error = getnewvnode(VT_UMAP, mp, umap_vnodeop_p, vpp);
if (error)
return (error);
vp = *vpp;
@ -227,7 +228,8 @@ umap_node_alloc(mp, lowervp, vpp)
* check to see if someone else has beaten us to it.
* (We could have slept in MALLOC.)
*/
if (othervp = umap_node_find(lowervp)) {
othervp = umap_node_find(lowervp);
if (othervp) {
FREE(xp, M_TEMP);
vp->v_type = VBAD; /* node is discarded */
vp->v_usecount = 0; /* XXX */
@ -254,7 +256,8 @@ umap_node_create(mp, targetvp, newvpp)
{
struct vnode *aliasvp;
if (aliasvp = umap_node_find(mp, targetvp)) {
aliasvp = umap_node_find(mp, targetvp);
if (aliasvp) {
/*
* Take another reference to the alias vnode
*/
@ -274,7 +277,8 @@ umap_node_create(mp, targetvp, newvpp)
/*
* Make new vnode reference the umap_node.
*/
if (error = umap_node_alloc(mp, targetvp, &aliasvp))
error = umap_node_alloc(mp, targetvp, &aliasvp);
if (error)
return (error);
/*

View file

@ -35,7 +35,7 @@
*
* @(#)umap_vfsops.c 8.3 (Berkeley) 1/21/94
*
* $Id: umap_vfsops.c,v 1.3 1994/09/21 03:47:11 wollman Exp $
* $Id: umap_vfsops.c,v 1.4 1994/09/22 19:38:19 wollman Exp $
*/
/*
@ -87,7 +87,8 @@ umapfs_mount(mp, path, data, ndp, p)
/*
* Get argument
*/
if (error = copyin(data, (caddr_t)&args, sizeof(struct umap_args)))
error = copyin(data, (caddr_t)&args, sizeof(struct umap_args));
if (error)
return (error);
/*
@ -95,7 +96,8 @@ umapfs_mount(mp, path, data, ndp, p)
*/
NDINIT(ndp, LOOKUP, FOLLOW|WANTPARENT|LOCKLEAF,
UIO_USERSPACE, args.target, p);
if (error = namei(ndp))
error = namei(ndp);
if (error)
return (error);
/*
@ -250,7 +252,8 @@ umapfs_unmount(mp, mntflags, p)
#endif
if (umapm_rootvp->v_usecount > 1)
return (EBUSY);
if (error = vflush(mp, umapm_rootvp, flags))
error = vflush(mp, umapm_rootvp, flags);
if (error)
return (error);
#ifdef UMAPFS_DIAGNOSTIC

View file

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)umap_vnops.c 8.3 (Berkeley) 1/5/94
* $Id: umap_vnops.c,v 1.5 1994/09/21 03:47:12 wollman Exp $
* $Id: umap_vnops.c,v 1.6 1994/09/21 23:22:43 wollman Exp $
*/
/*
@ -141,7 +141,7 @@ umap_bypass(ap)
credp = *credpp;
if (umap_bug_bypass && credp->cr_uid != 0)
printf("umap_bypass: user was %d, group %d\n",
printf("umap_bypass: user was %ld, group %ld\n",
credp->cr_uid, credp->cr_gid);
/* Map all ids in the credential structure. */
@ -149,7 +149,7 @@ umap_bypass(ap)
umap_mapids(vp1->v_mount, credp);
if (umap_bug_bypass && credp->cr_uid != 0)
printf("umap_bypass: user now %d, group %d\n",
printf("umap_bypass: user now %ld, group %ld\n",
credp->cr_uid, credp->cr_gid);
}
@ -167,7 +167,7 @@ umap_bypass(ap)
compcredp = (*compnamepp)->cn_cred = crdup(savecompcredp);
if (umap_bug_bypass && compcredp->cr_uid != 0)
printf("umap_bypass: component credit user was %d, group %d\n",
printf("umap_bypass: component credit user was %ld, group %ld\n",
compcredp->cr_uid, compcredp->cr_gid);
/* Map all ids in the credential structure. */
@ -175,7 +175,7 @@ umap_bypass(ap)
umap_mapids(vp1->v_mount, compcredp);
if (umap_bug_bypass && compcredp->cr_uid != 0)
printf("umap_bypass: component credit user now %d, group %d\n",
printf("umap_bypass: component credit user now %ld, group %ld\n",
compcredp->cr_uid, compcredp->cr_gid);
}
@ -222,25 +222,25 @@ umap_bypass(ap)
*/
if (descp->vdesc_cred_offset != VDESC_NO_OFFSET) {
if (umap_bug_bypass && credp && credp->cr_uid != 0)
printf("umap_bypass: returning-user was %d\n",
printf("umap_bypass: returning-user was %ld\n",
credp->cr_uid);
crfree(credp);
(*credpp) = savecredp;
if (umap_bug_bypass && credpp && (*credpp)->cr_uid != 0)
printf("umap_bypass: returning-user now %d\n\n",
printf("umap_bypass: returning-user now %ld\n\n",
(*credpp)->cr_uid);
}
if (descp->vdesc_componentname_offset != VDESC_NO_OFFSET) {
if (umap_bug_bypass && compcredp && compcredp->cr_uid != 0)
printf("umap_bypass: returning-component-user was %d\n",
printf("umap_bypass: returning-component-user was %ld\n",
compcredp->cr_uid);
crfree(compcredp);
(*compnamepp)->cn_cred = savecompcredp;
if (umap_bug_bypass && credpp && (*credpp)->cr_uid != 0)
printf("umap_bypass: returning-component-user now %d\n",
printf("umap_bypass: returning-component-user now %ld\n",
compcredp->cr_uid);
}
@ -266,7 +266,8 @@ umap_getattr(ap)
struct vnode **vp1p;
struct vnodeop_desc *descp = ap->a_desc;
if (error = umap_bypass(ap))
error = umap_bypass(ap);
if (error)
return (error);
/* Requires that arguments be restored. */
ap->a_vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0];
@ -407,7 +408,7 @@ umap_print(ap)
} */ *ap;
{
struct vnode *vp = ap->a_vp;
printf("\ttag VT_UMAPFS, vp=%x, lowervp=%x\n", vp, UMAPVPTOLOWERVP(vp));
printf("\ttag VT_UMAPFS, vp=%p, lowervp=%p\n", vp, UMAPVPTOLOWERVP(vp));
return (0);
}
@ -441,7 +442,7 @@ umap_rename(ap)
compcredp = compnamep->cn_cred = crdup(savecompcredp);
if (umap_bug_bypass && compcredp->cr_uid != 0)
printf("umap_rename: rename component credit user was %d, group %d\n",
printf("umap_rename: rename component credit user was %ld, group %ld\n",
compcredp->cr_uid, compcredp->cr_gid);
/* Map all ids in the credential structure. */
@ -449,7 +450,7 @@ umap_rename(ap)
umap_mapids(vp->v_mount, compcredp);
if (umap_bug_bypass && compcredp->cr_uid != 0)
printf("umap_rename: rename component credit user now %d, group %d\n",
printf("umap_rename: rename component credit user now %ld, group %ld\n",
compcredp->cr_uid, compcredp->cr_gid);
error = umap_bypass(ap);

View file

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_subr.c 8.4 (Berkeley) 2/17/94
* $Id: union_subr.c,v 1.3 1994/08/02 07:45:44 davidg Exp $
* $Id: union_subr.c,v 1.4 1994/10/06 21:06:48 davidg Exp $
*/
#include <sys/param.h>
@ -224,7 +224,6 @@ union_allocvp(vpp, mp, undvp, dvp, cnp, uppervp, lowervp)
{
int error;
struct union_node *un = 0;
struct union_node **pp;
struct vnode *xlowervp = NULLVP;
int hash = 0;
int try;
@ -594,7 +593,8 @@ union_mkshadow(um, dvp, cnp, vpp)
cn.cn_consume = cnp->cn_consume;
VREF(dvp);
if (error = relookup(dvp, vpp, &cn))
error = relookup(dvp, vpp, &cn);
if (error)
return (error);
vrele(dvp);
@ -638,7 +638,6 @@ union_vn_create(vpp, un, p)
int fmode = FFLAGS(O_WRONLY|O_CREAT|O_TRUNC|O_EXCL);
int error;
int cmode = UN_FILEMODE & ~p->p_fd->fd_cmask;
char *cp;
struct componentname cn;
*vpp = NULLVP;
@ -664,7 +663,8 @@ union_vn_create(vpp, un, p)
cn.cn_consume = 0;
VREF(un->un_dirvp);
if (error = relookup(un->un_dirvp, &vp, &cn))
error = relookup(un->un_dirvp, &vp, &cn);
if (error)
return (error);
vrele(un->un_dirvp);
@ -692,10 +692,12 @@ union_vn_create(vpp, un, p)
vap->va_type = VREG;
vap->va_mode = cmode;
LEASE_CHECK(un->un_dirvp, p, cred, LEASE_WRITE);
if (error = VOP_CREATE(un->un_dirvp, &vp, &cn, vap))
error = VOP_CREATE(un->un_dirvp, &vp, &cn, vap);
if (error)
return (error);
if (error = VOP_OPEN(vp, fmode, cred, p)) {
error = VOP_OPEN(vp, fmode, cred, p);
if (error) {
vput(vp);
return (error);
}

View file

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_vfsops.c 8.7 (Berkeley) 3/5/94
* $Id: union_vfsops.c,v 1.4 1994/09/21 03:47:13 wollman Exp $
* $Id: union_vfsops.c,v 1.5 1994/09/22 19:38:20 wollman Exp $
*/
/*
@ -127,7 +127,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;
@ -147,7 +148,8 @@ union_mount(mp, path, data, ndp, p)
UIO_USERSPACE, args.target, p);
p->p_ucred = scred;
if (error = namei(ndp))
error = namei(ndp);
if (error)
goto bad;
upperrootvp = ndp->ni_vp;
@ -317,13 +319,15 @@ union_unmount(mp, mntflags, p)
flags |= FORCECLOSE;
}
if (error = union_root(mp, &um_rootvp))
error = union_root(mp, &um_rootvp);
if (error)
return (error);
if (um_rootvp->v_usecount > 1) {
vput(um_rootvp);
return (EBUSY);
}
if (error = vflush(mp, um_rootvp, flags)) {
error = vflush(mp, um_rootvp, flags);
if (error) {
vput(um_rootvp);
return (error);
}

View file

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_vnops.c 8.6 (Berkeley) 2/17/94
* $Id: union_vnops.c,v 1.5 1994/09/21 23:22:45 wollman Exp $
* $Id: union_vnops.c,v 1.6 1994/10/06 21:06:49 davidg Exp $
*/
#include <sys/param.h>
@ -132,7 +132,8 @@ union_lookup1(udvp, dvp, vpp, cnp)
continue;
}
if (error = VFS_ROOT(mp, &tdvp)) {
error = VFS_ROOT(mp, &tdvp);
if (error) {
vput(dvp);
return (error);
}
@ -162,7 +163,6 @@ union_lookup(ap)
struct union_node *dun = VTOUNION(dvp);
struct componentname *cnp = ap->a_cnp;
int lockparent = cnp->cn_flags & LOCKPARENT;
int rdonly = cnp->cn_flags & RDONLY;
struct union_mount *um = MOUNTTOUNIONMOUNT(dvp->v_mount);
struct ucred *saved_cred = 0;
@ -574,12 +574,14 @@ union_access(ap)
int error = EACCES;
struct vnode *vp;
if (vp = un->un_uppervp) {
vp = un->un_uppervp;
if (vp) {
FIXUP(un);
return (VOP_ACCESS(vp, ap->a_mode, ap->a_cred, ap->a_p));
}
if (vp = un->un_lowervp) {
vp = un->un_lowervp;
if (vp) {
VOP_LOCK(vp);
error = VOP_ACCESS(vp, ap->a_mode, ap->a_cred, ap->a_p);
if (error == 0) {
@ -1109,7 +1111,6 @@ union_symlink(ap)
if (dvp) {
int error;
struct vnode *vp;
struct mount *mp = ap->a_dvp->v_mount;
FIXUP(un);
VREF(dvp);
@ -1357,7 +1358,7 @@ union_print(ap)
{
struct vnode *vp = ap->a_vp;
printf("\ttag VT_UNION, vp=%x, uppervp=%x, lowervp=%x\n",
printf("\ttag VT_UNION, vp=%p, uppervp=%p, lowervp=%p\n",
vp, UPPERVP(vp), LOWERVP(vp));
return (0);
}