diff --git a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c index d4df5c89db02..2f581bd09253 100644 --- a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c +++ b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c @@ -168,10 +168,8 @@ zfs_sync(vfs_t *vfsp, int flag, cred_t *cr) return (0); /* Allocate a marker vnode. */ - if ((mvp = vnalloc(vfsp)) == NULL) - return (ENOMEM); - - + mvp = vnalloc(vfsp); + /* * On NetBSD, we need to push out atime updates. Solaris does * this during VOP_INACTIVE, but that does not work well with the diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index e061ee062adc..8400e26bad48 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_vfsops.c,v 1.91 2011/06/12 03:35:53 rmind Exp $ */ +/* $NetBSD: msdosfs_vfsops.c,v 1.92 2011/10/07 09:35:04 hannken Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.91 2011/06/12 03:35:53 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.92 2011/10/07 09:35:04 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -953,8 +953,7 @@ msdosfs_sync(struct mount *mp, int waitfor, kauth_cred_t cred) } } /* Allocate a marker vnode. */ - if ((mvp = vnalloc(mp)) == NULL) - return ENOMEM; + mvp = vnalloc(mp); fstrans_start(mp, FSTRANS_SHARED); /* * Write back each (modified) denode. diff --git a/sys/fs/puffs/puffs_vfsops.c b/sys/fs/puffs/puffs_vfsops.c index d33210e8fa8b..b101713bdbfc 100644 --- a/sys/fs/puffs/puffs_vfsops.c +++ b/sys/fs/puffs/puffs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_vfsops.c,v 1.97 2011/09/21 15:36:33 manu Exp $ */ +/* $NetBSD: puffs_vfsops.c,v 1.98 2011/10/07 09:35:05 hannken Exp $ */ /* * Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.97 2011/09/21 15:36:33 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.98 2011/10/07 09:35:05 hannken Exp $"); #include #include @@ -519,8 +519,7 @@ pageflush(struct mount *mp, kauth_cred_t cred, int waitfor) fsyncwait = (waitfor == MNT_WAIT) ? FSYNC_WAIT : 0; /* Allocate a marker vnode. */ - if ((mvp = vnalloc(mp)) == NULL) - return ENOMEM; + mvp = vnalloc(mp); /* * Sync all cached data from regular vnodes (which are not diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c index 41deeb948a50..745e7688ed28 100644 --- a/sys/fs/smbfs/smbfs_vfsops.c +++ b/sys/fs/smbfs/smbfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: smbfs_vfsops.c,v 1.94 2011/06/12 03:35:54 rmind Exp $ */ +/* $NetBSD: smbfs_vfsops.c,v 1.95 2011/10/07 09:35:05 hannken Exp $ */ /* * Copyright (c) 2000-2001, Boris Popov @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.94 2011/06/12 03:35:54 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.95 2011/10/07 09:35:05 hannken Exp $"); #include #include @@ -418,8 +418,7 @@ smbfs_sync(struct mount *mp, int waitfor, kauth_cred_t cred) int error, allerror = 0; /* Allocate a marker vnode. */ - if ((mvp = vnalloc(mp)) == NULL) - return ENOMEM; + mvp = vnalloc(mp); /* * Force stale buffer cache information to be flushed. */ diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index f6494c1da590..2f4e78eb0f38 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_mount.c,v 1.9 2011/09/01 12:29:41 christos Exp $ */ +/* $NetBSD: vfs_mount.c,v 1.10 2011/10/07 09:35:05 hannken Exp $ */ /*- * Copyright (c) 1997-2011 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.9 2011/09/01 12:29:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.10 2011/10/07 09:35:05 hannken Exp $"); #include #include @@ -443,9 +443,6 @@ vflush(struct mount *mp, vnode_t *skipvp, int flags) /* Allocate a marker vnode. */ mvp = vnalloc(mp); - if (mvp == NULL) { - return ENOMEM; - } /* * NOTE: not using the TAILQ_FOREACH here since in this loop vgone() diff --git a/sys/kern/vfs_vnode.c b/sys/kern/vfs_vnode.c index 93de73c34388..fa56349ed4b9 100644 --- a/sys/kern/vfs_vnode.c +++ b/sys/kern/vfs_vnode.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_vnode.c,v 1.13 2011/10/03 10:30:13 hannken Exp $ */ +/* $NetBSD: vfs_vnode.c,v 1.14 2011/10/07 09:35:06 hannken Exp $ */ /*- * Copyright (c) 1997-2011 The NetBSD Foundation, Inc. @@ -120,7 +120,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.13 2011/10/03 10:30:13 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.14 2011/10/07 09:35:06 hannken Exp $"); #include #include @@ -352,7 +352,6 @@ getnewvnode(enum vtagtype tag, struct mount *mp, int (**vops)(void *), vnode_t *vp; int error = 0; -try_again: if (mp != NULL) { /* * Mark filesystem busy while we are creating a vnode. @@ -371,25 +370,14 @@ try_again: if (numvnodes > desiredvnodes + desiredvnodes / 10) cv_signal(&vdrain_cv); mutex_exit(&vnode_free_list_lock); - if ((vp = vnalloc(NULL)) == NULL) { - mutex_enter(&vnode_free_list_lock); - numvnodes--; - mutex_exit(&vnode_free_list_lock); - if (mp != NULL) { - vfs_unbusy(mp, false, NULL); - } - printf("WARNING: unable to allocate new vnode, retrying...\n"); - kpause("newvn", false, hz, NULL); - goto try_again; - } - - vp->v_usecount = 1; + vp = vnalloc(NULL); KASSERT(vp->v_freelisthd == NULL); KASSERT(LIST_EMPTY(&vp->v_nclist)); KASSERT(LIST_EMPTY(&vp->v_dnclist)); /* Initialize vnode. */ + vp->v_usecount = 1; vp->v_type = VNON; vp->v_tag = tag; vp->v_op = vops; diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index e59ae9117e7c..b682a2cc6251 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_vfsops.c,v 1.218 2011/06/12 03:35:59 rmind Exp $ */ +/* $NetBSD: nfs_vfsops.c,v 1.219 2011/10/07 09:35:06 hannken Exp $ */ /* * Copyright (c) 1989, 1993, 1995 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.218 2011/06/12 03:35:59 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.219 2011/10/07 09:35:06 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_nfs.h" @@ -953,8 +953,7 @@ nfs_sync(struct mount *mp, int waitfor, kauth_cred_t cred) /* * Force stale buffer cache information to be flushed. */ - if ((mvp = vnalloc(mp)) == NULL) - return (ENOMEM); + mvp = vnalloc(mp); loop: /* * NOTE: not using the TAILQ_FOREACH here since in this loop vgone() diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c index 2e628d8c5b11..f0db5ec7a9f9 100644 --- a/sys/ufs/ext2fs/ext2fs_vfsops.c +++ b/sys/ufs/ext2fs/ext2fs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ext2fs_vfsops.c,v 1.160 2011/06/12 03:36:00 rmind Exp $ */ +/* $NetBSD: ext2fs_vfsops.c,v 1.161 2011/10/07 09:35:06 hannken Exp $ */ /* * Copyright (c) 1989, 1991, 1993, 1994 @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.160 2011/06/12 03:36:00 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.161 2011/10/07 09:35:06 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -592,8 +592,7 @@ ext2fs_reload(struct mount *mp, kauth_cred_t cred, struct lwp *l) } /* Allocate a marker vnode. */ - if ((mvp = vnalloc(mp)) == NULL) - return ENOMEM; + mvp = vnalloc(mp); /* * NOTE: not using the TAILQ_FOREACH here since in this loop vgone() * and vclean() can be called indirectly @@ -914,8 +913,7 @@ ext2fs_sync(struct mount *mp, int waitfor, kauth_cred_t cred) } /* Allocate a marker vnode. */ - if ((mvp = vnalloc(mp)) == NULL) - return (ENOMEM); + mvp = vnalloc(mp); /* * Write back each (modified) inode. diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 544c0eb60775..b1e07c11c0bd 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -1,4 +1,4 @@ -/* $NetBSD: ffs_snapshot.c,v 1.117 2011/07/01 14:28:21 hannken Exp $ */ +/* $NetBSD: ffs_snapshot.c,v 1.118 2011/10/07 09:35:06 hannken Exp $ */ /* * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.117 2011/07/01 14:28:21 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.118 2011/10/07 09:35:06 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_ffs.h" @@ -629,10 +629,7 @@ snapshot_expunge(struct mount *mp, struct vnode *vp, struct fs *copy_fs, /* * Allocate a marker vnode. */ - if ((mvp = vnalloc(mp)) == NULL) { - error = ENOMEM; - goto out; - } + mvp = vnalloc(mp); /* * We also calculate the needed size for the snapshot list. */ diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index aad9132ffd75..f8d57711e941 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ffs_vfsops.c,v 1.268 2011/06/17 14:23:52 manu Exp $ */ +/* $NetBSD: ffs_vfsops.c,v 1.269 2011/10/07 09:35:07 hannken Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.268 2011/06/17 14:23:52 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.269 2011/10/07 09:35:07 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_ffs.h" @@ -785,8 +785,7 @@ ffs_reload(struct mount *mp, kauth_cred_t cred, struct lwp *l) } /* Allocate a marker vnode. */ - if ((mvp = vnalloc(mp)) == NULL) - return ENOMEM; + mvp = vnalloc(mp); /* * NOTE: not using the TAILQ_FOREACH here since in this loop vgone() * and vclean() can be called indirectly @@ -1598,8 +1597,7 @@ ffs_sync(struct mount *mp, int waitfor, kauth_cred_t cred) } /* Allocate a marker vnode. */ - if ((mvp = vnalloc(mp)) == NULL) - return (ENOMEM); + mvp = vnalloc(mp); fstrans_start(mp, FSTRANS_SHARED); is_suspending = (fstrans_getstate(mp) == FSTRANS_SUSPENDING); diff --git a/sys/ufs/ufs/ufs_quota1.c b/sys/ufs/ufs/ufs_quota1.c index 1e6133895c41..104b6de43fb7 100644 --- a/sys/ufs/ufs/ufs_quota1.c +++ b/sys/ufs/ufs/ufs_quota1.c @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_quota1.c,v 1.4 2011/06/12 03:36:02 rmind Exp $ */ +/* $NetBSD: ufs_quota1.c,v 1.5 2011/10/07 09:35:07 hannken Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993, 1995 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ufs_quota1.c,v 1.4 2011/06/12 03:36:02 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ufs_quota1.c,v 1.5 2011/10/07 09:35:07 hannken Exp $"); #include #include @@ -368,10 +368,7 @@ quota1_handle_cmd_quotaon(struct lwp *l, struct ufsmount *ump, int type, dqrele(NULLVP, dq); } /* Allocate a marker vnode. */ - if ((mvp = vnalloc(mp)) == NULL) { - error = ENOMEM; - goto out; - } + mvp = vnalloc(mp); /* * Search vnodes associated with this mount point, * adding references to quota file being opened. @@ -405,7 +402,7 @@ again: } mutex_exit(&mntvnode_lock); vnfree(mvp); - out: + mutex_enter(&dqlock); ump->umq1_qflags[type] &= ~QTF_OPENING; cv_broadcast(&dqcv); @@ -432,8 +429,7 @@ quota1_handle_cmd_quotaoff(struct lwp *l, struct ufsmount *ump, int type) int i, error; /* Allocate a marker vnode. */ - if ((mvp = vnalloc(mp)) == NULL) - return ENOMEM; + mvp = vnalloc(mp); mutex_enter(&dqlock); while ((ump->umq1_qflags[type] & (QTF_CLOSING | QTF_OPENING)) != 0) @@ -760,8 +756,7 @@ q1sync(struct mount *mp) return (0); /* Allocate a marker vnode. */ - if ((mvp = vnalloc(mp)) == NULL) - return (ENOMEM); + mvp = vnalloc(mp); /* * Search vnodes associated with this mount point,