valloc -> vnalloc, vfree -> vnfree

Avoids collision with userland valloc(3).

no functional change
ad ok
This commit is contained in:
pooka 2008-01-03 01:26:28 +00:00
parent 09fd56f9ec
commit d53e261066
11 changed files with 62 additions and 60 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: msdosfs_vfsops.c,v 1.56 2008/01/02 11:48:41 ad Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.57 2008/01/03 01:26:28 pooka Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.56 2008/01/02 11:48:41 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.57 2008/01/03 01:26:28 pooka Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@ -954,7 +954,7 @@ msdosfs_sync(mp, waitfor, cred)
}
}
/* Allocate a marker vnode. */
if ((mvp = valloc(mp)) == NULL)
if ((mvp = vnalloc(mp)) == NULL)
return ENOMEM;
/*
* Write back each (modified) denode.
@ -992,7 +992,7 @@ loop:
mutex_enter(&mntvnode_lock);
}
mutex_exit(&mntvnode_lock);
vfree(mvp);
vnfree(mvp);
/*
* Force stale file system control information to be flushed.

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs_vfsops.c,v 1.75 2008/01/02 22:37:21 pooka Exp $ */
/* $NetBSD: puffs_vfsops.c,v 1.76 2008/01/03 01:26:29 pooka Exp $ */
/*
* Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.75 2008/01/02 22:37:21 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.76 2008/01/03 01:26:29 pooka Exp $");
#include <sys/param.h>
#include <sys/mount.h>
@ -439,7 +439,7 @@ pageflush(struct mount *mp, kauth_cred_t cred, int waitfor, int suspending)
error = 0;
/* Allocate a marker vnode. */
if ((mvp = valloc(mp)) == NULL)
if ((mvp = vnalloc(mp)) == NULL)
return ENOMEM;
/*
@ -530,7 +530,7 @@ pageflush(struct mount *mp, kauth_cred_t cred, int waitfor, int suspending)
mutex_enter(&mntvnode_lock);
}
mutex_exit(&mntvnode_lock);
vfree(mvp);
vnfree(mvp);
return error;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: smbfs_vfsops.c,v 1.74 2008/01/02 11:48:45 ad Exp $ */
/* $NetBSD: smbfs_vfsops.c,v 1.75 2008/01/03 01:26:29 pooka Exp $ */
/*
* Copyright (c) 2000-2001, Boris Popov
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.74 2008/01/02 11:48:45 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.75 2008/01/03 01:26:29 pooka Exp $");
#ifdef _KERNEL_OPT
#include "opt_quota.h"
@ -399,7 +399,7 @@ smbfs_sync(struct mount *mp, int waitfor, kauth_cred_t cred)
int error, allerror = 0;
/* Allocate a marker vnode. */
if ((mvp = valloc(mp)) == NULL)
if ((mvp = vnalloc(mp)) == NULL)
return ENOMEM;
/*
* Force stale buffer cache information to be flushed.
@ -444,7 +444,7 @@ loop:
mutex_enter(&mntvnode_lock);
}
mutex_exit(&mntvnode_lock);
vfree(mvp);
vnfree(mvp);
return (allerror);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_subr.c,v 1.309 2008/01/02 11:48:56 ad Exp $ */
/* $NetBSD: vfs_subr.c,v 1.310 2008/01/03 01:26:30 pooka Exp $ */
/*-
* Copyright (c) 1997, 1998, 2004, 2005, 2007 The NetBSD Foundation, Inc.
@ -82,7 +82,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.309 2008/01/02 11:48:56 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.310 2008/01/03 01:26:30 pooka Exp $");
#include "opt_inet.h"
#include "opt_ddb.h"
@ -451,7 +451,7 @@ getnewvnode(enum vtagtype tag, struct mount *mp, int (**vops)(void *),
if (tryalloc) {
numvnodes++;
mutex_exit(&vnode_free_list_lock);
if ((vp = valloc(NULL)) == NULL) {
if ((vp = vnalloc(NULL)) == NULL) {
mutex_enter(&vnode_free_list_lock);
numvnodes--;
} else
@ -535,7 +535,7 @@ ungetnewvnode(vnode_t *vp)
* marker vnode and we are prepared to wait for the allocation.
*/
vnode_t *
valloc(struct mount *mp)
vnalloc(struct mount *mp)
{
vnode_t *vp;
@ -568,7 +568,7 @@ valloc(struct mount *mp)
* Free an unused, unreferenced vnode.
*/
void
vfree(vnode_t *vp)
vnfree(vnode_t *vp)
{
KASSERT(vp->v_usecount == 0);
@ -1009,7 +1009,7 @@ vrelel(vnode_t *vp, int doinactive, int onhead)
KASSERT(vp->v_writecount == 0);
mutex_exit(&vp->v_interlock);
insmntque(vp, NULL);
vfree(vp);
vnfree(vp);
} else {
/*
* Otherwise, put it back onto the freelist. It
@ -1161,7 +1161,7 @@ vflush(struct mount *mp, vnode_t *skipvp, int flags)
int busy = 0;
/* Allocate a marker vnode. */
if ((mvp = valloc(mp)) == NULL)
if ((mvp = vnalloc(mp)) == NULL)
return (ENOMEM);
mutex_enter(&mntvnode_lock);
@ -1235,7 +1235,7 @@ vflush(struct mount *mp, vnode_t *skipvp, int flags)
busy++;
}
mutex_exit(&mntvnode_lock);
vfree(mvp);
vnfree(mvp);
if (busy)
return (EBUSY);
return (0);
@ -1640,7 +1640,7 @@ sysctl_kern_vnode(SYSCTLFN_ARGS)
}
savebp = bp;
/* Allocate a marker vnode. */
if ((mvp = valloc(mp)) == NULL)
if ((mvp = vnalloc(mp)) == NULL)
return (ENOMEM);
mutex_enter(&mntvnode_lock);
for (vp = TAILQ_FIRST(&mp->mnt_vnodelist); vp; vp = vunmark(mvp)) {
@ -1655,7 +1655,7 @@ sysctl_kern_vnode(SYSCTLFN_ARGS)
if (bp + VPTRSZ + VNODESZ > ewhere) {
(void)vunmark(mvp);
mutex_exit(&mntvnode_lock);
vfree(mvp);
vnfree(mvp);
*sizep = bp - where;
return (ENOMEM);
}
@ -1666,7 +1666,7 @@ sysctl_kern_vnode(SYSCTLFN_ARGS)
mutex_enter(&mntvnode_lock);
(void)vunmark(mvp);
mutex_exit(&mntvnode_lock);
vfree(mvp);
vnfree(mvp);
return (error);
}
bp += VPTRSZ + VNODESZ;
@ -1676,7 +1676,7 @@ sysctl_kern_vnode(SYSCTLFN_ARGS)
mutex_enter(&mountlist_lock);
nmp = CIRCLEQ_NEXT(mp, mnt_list);
vfs_unbusy(mp);
vfree(mvp);
vnfree(mvp);
}
mutex_exit(&mountlist_lock);

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_vfsops.c,v 1.190 2008/01/02 19:26:46 yamt Exp $ */
/* $NetBSD: nfs_vfsops.c,v 1.191 2008/01/03 01:26:30 pooka Exp $ */
/*
* Copyright (c) 1989, 1993, 1995
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.190 2008/01/02 19:26:46 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.191 2008/01/03 01:26:30 pooka Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -946,7 +946,7 @@ nfs_sync(mp, waitfor, cred)
/*
* Force stale buffer cache information to be flushed.
*/
if ((mvp = valloc(mp)) == NULL)
if ((mvp = vnalloc(mp)) == NULL)
return (ENOMEM);
loop:
/*
@ -979,7 +979,7 @@ loop:
mutex_enter(&mntvnode_lock);
}
mutex_exit(&mntvnode_lock);
vfree(mvp);
vnfree(mvp);
return (allerror);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs.c,v 1.25 2008/01/02 18:15:15 pooka Exp $ */
/* $NetBSD: vfs.c,v 1.26 2008/01/03 01:26:31 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -173,7 +173,7 @@ vrele2(struct vnode *vp, bool onhead)
}
vnode_t *
valloc(struct mount *mp)
vnalloc(struct mount *mp)
{
struct vnode *vp;
struct uvm_object *uobj;
@ -195,10 +195,10 @@ valloc(struct mount *mp)
void
vfree(vnode_t *vp)
vnfree(vnode_t *vp)
{
rumpuser_free(vp);
kmem_free(vp, sizeof(struct vnode));
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: vnode.h,v 1.180 2008/01/02 11:49:07 ad Exp $ */
/* $NetBSD: vnode.h,v 1.181 2008/01/03 01:26:31 pooka Exp $ */
/*
* Copyright (c) 1989, 1993
@ -568,10 +568,12 @@ void vwakeup(struct buf *);
void vwait(struct vnode *, int);
void vclean(struct vnode *, int);
void vrelel(struct vnode *, int, int);
struct vnode *valloc(struct mount *);
void vfree(struct vnode *);
struct vnode *
vnalloc(struct mount *);
void vnfree(struct vnode *);
void vmark(struct vnode *, struct vnode *);
struct vnode *vunmark(struct vnode *);
struct vnode *
vunmark(struct vnode *);
void vn_init1(void);
/* see vnsubr(9) */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ext2fs_vfsops.c,v 1.126 2008/01/02 11:49:08 ad Exp $ */
/* $NetBSD: ext2fs_vfsops.c,v 1.127 2008/01/03 01:26:31 pooka Exp $ */
/*
* Copyright (c) 1989, 1991, 1993, 1994
@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.126 2008/01/02 11:49:08 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.127 2008/01/03 01:26:31 pooka Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -545,7 +545,7 @@ ext2fs_reload(struct mount *mountp, kauth_cred_t cred)
}
/* Allocate a marker vnode. */
if ((mvp = valloc(mountp)) == NULL)
if ((mvp = vnalloc(mountp)) == NULL)
return (ENOMEM);
/*
* NOTE: not using the TAILQ_FOREACH here since in this loop vgone()
@ -597,7 +597,7 @@ loop:
mutex_enter(&mntvnode_lock);
}
mutex_exit(&mntvnode_lock);
vfree(mvp);
vnfree(mvp);
return (error);
}
@ -869,7 +869,7 @@ ext2fs_sync(struct mount *mp, int waitfor, kauth_cred_t cred)
}
/* Allocate a marker vnode. */
if ((mvp = valloc(mp)) == NULL)
if ((mvp = vnalloc(mp)) == NULL)
return (ENOMEM);
/*
@ -919,7 +919,7 @@ loop:
mutex_enter(&mntvnode_lock);
}
mutex_exit(&mntvnode_lock);
vfree(mvp);
vnfree(mvp);
/*
* Force stale file system control information to be flushed.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_snapshot.c,v 1.57 2008/01/02 11:49:09 ad Exp $ */
/* $NetBSD: ffs_snapshot.c,v 1.58 2008/01/03 01:26:32 pooka Exp $ */
/*
* Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.57 2008/01/02 11:49:09 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.58 2008/01/03 01:26:32 pooka Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@ -427,7 +427,7 @@ ffs_snapshot(struct mount *mp, struct vnode *vp,
snaplistsize = fs->fs_ncg + howmany(fs->fs_cssize, fs->fs_bsize) +
FSMAXSNAP + 1 /* superblock */ + 1 /* last block */ + 1 /* size */;
/* Allocate a marker vnode */
if ((mvp = valloc(mp)) == NULL) {
if ((mvp = vnalloc(mp)) == NULL) {
error = ENOMEM;
goto out1;
}
@ -505,7 +505,7 @@ ffs_snapshot(struct mount *mp, struct vnode *vp,
MNT_ILOCK(mp);
}
MNT_IUNLOCK(mp);
vfree(mvp);
vnfree(mvp);
/*
* If there already exist snapshots on this filesystem, grab a
* reference to their shared lock. If this is the first snapshot

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_vfsops.c,v 1.214 2008/01/02 11:49:09 ad Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.215 2008/01/03 01:26:32 pooka Exp $ */
/*
* Copyright (c) 1989, 1991, 1993, 1994
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.214 2008/01/02 11:49:09 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.215 2008/01/03 01:26:32 pooka Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@ -648,7 +648,7 @@ ffs_reload(struct mount *mp, kauth_cred_t cred, struct lwp *l)
}
/* Allocate a marker vnode. */
if ((mvp = valloc(mp)) == NULL)
if ((mvp = vnalloc(mp)) == NULL)
return ENOMEM;
/*
* NOTE: not using the TAILQ_FOREACH here since in this loop vgone()
@ -698,7 +698,7 @@ ffs_reload(struct mount *mp, kauth_cred_t cred, struct lwp *l)
mutex_enter(&mntvnode_lock);
}
mutex_exit(&mntvnode_lock);
vfree(mvp);
vnfree(mvp);
return (error);
}
@ -1341,7 +1341,7 @@ ffs_sync(struct mount *mp, int waitfor, kauth_cred_t cred)
}
/* Allocate a marker vnode. */
if ((mvp = valloc(mp)) == NULL)
if ((mvp = vnalloc(mp)) == NULL)
return (ENOMEM);
fstrans_start(mp, FSTRANS_SHARED);
@ -1436,7 +1436,7 @@ loop:
allerror = error;
}
fstrans_done(mp);
vfree(mvp);
vnfree(mvp);
return (allerror);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_quota.c,v 1.53 2008/01/02 11:49:14 ad Exp $ */
/* $NetBSD: ufs_quota.c,v 1.54 2008/01/03 01:26:32 pooka Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993, 1995
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.53 2008/01/02 11:49:14 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.54 2008/01/03 01:26:32 pooka Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -453,7 +453,7 @@ quotaon(struct lwp *l, struct mount *mp, int type, void *fname)
dqrele(NULLVP, dq);
}
/* Allocate a marker vnode. */
if ((mvp = valloc(mp)) == NULL) {
if ((mvp = vnalloc(mp)) == NULL) {
error = ENOMEM;
goto out;
}
@ -487,7 +487,7 @@ again:
vput(vp);
}
mutex_exit(&mntvnode_lock);
vfree(mvp);
vnfree(mvp);
out:
mutex_enter(&dqlock);
ump->um_qflags[type] &= ~QTF_OPENING;
@ -513,7 +513,7 @@ quotaoff(struct lwp *l, struct mount *mp, int type)
int i, error;
/* Allocate a marker vnode. */
if ((mvp = valloc(mp)) == NULL)
if ((mvp = vnalloc(mp)) == NULL)
return ENOMEM;
mutex_enter(&dqlock);
@ -521,7 +521,7 @@ quotaoff(struct lwp *l, struct mount *mp, int type)
cv_wait(&dqcv, &dqlock);
if ((qvp = ump->um_quotas[type]) == NULLVP) {
mutex_exit(&dqlock);
vfree(mvp);
vnfree(mvp);
return (0);
}
ump->um_qflags[type] |= QTF_CLOSING;
@ -707,7 +707,7 @@ qsync(struct mount *mp)
return (0);
/* Allocate a marker vnode. */
if ((mvp = valloc(mp)) == NULL)
if ((mvp = vnalloc(mp)) == NULL)
return (ENOMEM);
/*
@ -746,7 +746,7 @@ qsync(struct mount *mp)
mutex_enter(&mntvnode_lock);
}
mutex_exit(&mntvnode_lock);
vfree(mvp);
vnfree(mvp);
return (0);
}