1*961ae58bSjmc.\" $OpenBSD: getnewvnode.9,v 1.11 2020/11/14 10:35:58 jmc Exp $ 2ac0b1781Scsapuntz.\" 3ac0b1781Scsapuntz.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved. 4ac0b1781Scsapuntz.\" 5ac0b1781Scsapuntz.\" Redistribution and use in source and binary forms, with or without 6ac0b1781Scsapuntz.\" modification, are permitted provided that the following conditions 7ac0b1781Scsapuntz.\" are met: 8ac0b1781Scsapuntz.\" 1. Redistributions of source code must retain the above copyright 9ac0b1781Scsapuntz.\" notice(s), this list of conditions and the following disclaimer as 10ac0b1781Scsapuntz.\" the first lines of this file unmodified other than the possible 11ac0b1781Scsapuntz.\" addition of one or more copyright notices. 12ac0b1781Scsapuntz.\" 2. Redistributions in binary form must reproduce the above copyright 13ac0b1781Scsapuntz.\" notice(s), this list of conditions and the following disclaimer in the 14ac0b1781Scsapuntz.\" documentation and/or other materials provided with the distribution. 15ac0b1781Scsapuntz.\" 16ac0b1781Scsapuntz.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY 17ac0b1781Scsapuntz.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18ac0b1781Scsapuntz.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19ac0b1781Scsapuntz.\" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 20ac0b1781Scsapuntz.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21ac0b1781Scsapuntz.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22ac0b1781Scsapuntz.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23ac0b1781Scsapuntz.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24ac0b1781Scsapuntz.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25ac0b1781Scsapuntz.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 26ac0b1781Scsapuntz.\" DAMAGE. 27ac0b1781Scsapuntz.\" 28ac0b1781Scsapuntz.\" $FreeBSD: src/share/man/man9/getnewvnode.9,v 1.1 2001/12/02 02:13:35 alfred Exp $ 29ac0b1781Scsapuntz.\" 30*961ae58bSjmc.Dd $Mdocdate: November 14 2020 $ 31ac0b1781Scsapuntz.Dt GETNEWVNODE 9 32ac0b1781Scsapuntz.Os 33ac0b1781Scsapuntz.Sh NAME 34ac0b1781Scsapuntz.Nm getnewvnode 3573d4fc9bSjmc.Nd get a new vnode 36ac0b1781Scsapuntz.Sh SYNOPSIS 37dddd2645Sschwarze.In sys/param.h 38dddd2645Sschwarze.In sys/vnode.h 39dddd2645Sschwarze.In sys/mount.h 40ac0b1781Scsapuntz.Ft int 41ac0b1781Scsapuntz.Fo getnewvnode 42ac0b1781Scsapuntz.Fa "enum vtagtype tag" 43ac0b1781Scsapuntz.Fa "struct mount *mp" 44cedc705eSclaudio.Fa "const struct vops *vops" 45ac0b1781Scsapuntz.Fa "struct vnode **vpp" 46ac0b1781Scsapuntz.Fc 47ac0b1781Scsapuntz.Sh DESCRIPTION 48ac0b1781ScsapuntzThe 49ac0b1781Scsapuntz.Fn getnewvnode 50ac0b1781Scsapuntzfunction initializes a new vnode, assigning it the vnode operations passed in 51ac0b1781Scsapuntz.Fa vops . 52ac0b1781ScsapuntzIt will have its v_tag field set to 53ac0b1781Scsapuntz.Fa tag 54ac0b1781Scsapuntzand be placed in the mount queue for the mount point represented by 55ac0b1781Scsapuntz.Fa mp . 56ac0b1781Scsapuntz.Pp 57ac0b1781ScsapuntzThe vnode is either freshly allocated, taken from the free list or taken from 584c8a7c32Smpechthe hold list. 594c8a7c32SmpechIf there are no vnodes on the free list, half the time a vnode 60ac0b1781Scsapuntzreferencing buffers will be taken from the hold list, otherwise it will be 61ac0b1781Scsapuntzfreshly allocated. 62ac0b1781Scsapuntz.Pp 63ac0b1781ScsapuntzThe arguments to 64ac0b1781Scsapuntz.Fn getnewvnode 65ac0b1781Scsapuntzare: 66*961ae58bSjmc.Bl -tag -width "vops" 67ac0b1781Scsapuntz.It Fa tag 68ac0b1781ScsapuntzThe file system type. 69ac0b1781Scsapuntz.It Fa mp 70ac0b1781ScsapuntzThe mount point to add the new vnode to. 71ac0b1781Scsapuntz.It Fa vops 72ac0b1781ScsapuntzThe vnode operations to assign to the new vnode. 73ac0b1781Scsapuntz.It Fa vpp 74ac0b1781ScsapuntzPoints to the new vnode upon successful completion. 75ac0b1781Scsapuntz.El 76ac0b1781Scsapuntz.Sh RETURN VALUES 77ac0b1781Scsapuntz.Fn getnewvnode 78ac0b1781Scsapuntzreturns 0 on success, or ENFILE if the vnode table is full. 79ac0b1781Scsapuntz.Sh AUTHORS 80ac0b1781ScsapuntzThis man page was originally written by 81f0641c22Sschwarze.An Chad David Aq Mt davidc@acns.ab.ca 824c8a7c32Smpechfor 834c8a7c32Smpech.Fx . 84