1.\" $NetBSD: puffs_node.3,v 1.3 2007/12/01 19:18:50 wiz Exp $ 2.\" 3.\" Copyright (c) 2007 Antti Kantee. All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" 26.Dd June 24, 2007 27.Dt PUFFS_NODE 3 28.Os 29.Sh NAME 30.Nm puffs_node 31.Nd puffs node routines 32.Sh LIBRARY 33.Lb libpuffs 34.Sh SYNOPSIS 35.In puffs.h 36.Ft struct puffs_node * 37.Fn puffs_pn_new "struct puffs_usermount *pu" "void *priv" 38.Ft void * 39.Fo puffs_nodewalk_fn 40.Fa "struct puffs_usermount *pu" "struct puffs_node *pn" "void *arg" 41.Fc 42.Ft void * 43.Fo puffs_pn_nodewalk 44.Fa "struct puffs_usermount *pu" "puffs_nodewalk_fn nwfn" "void *arg" 45.Fc 46.Ft void 47.Fn puffs_pn_remove "struct puffs_node *pn" 48.Ft void 49.Fn puffs_pn_put "struct puffs_node *pn" 50.Sh DESCRIPTION 51.Em IMPORTANT NOTE! 52This document describes interfaces which are not yet guaranteed to be 53stable. 54In case you update your system sources, please recompile everything 55and fix compilation errors. 56If your sources are out-of-sync, incorrect operation may result. 57The interfaces in this document will most likely be hugely simplified 58in later versions or made transparent to the implementation. 59.Pp 60.Em MORE IMPORTANT STUFF! 61It should especially be noted, that it is yet completely unsure, how 62much of the internals contents of 63.Vt struct puffs_node 64will be exposed to file systems in the end. 65.Pp 66.Bl -tag -width xxxx 67.It Fn puffs_pn_new pu priv 68Create a new node and attach it to the mountpoint 69.Ar pu . 70The argument 71.Ar priv 72can be used for associating file system specific data with the new 73node and will not be accessed by puffs. 74.It Fn puffs_nodewalk_fn pu pn arg 75A callback for 76.Fn puffs_nodewalk . 77The list of nodes is iterated in the argument 78.Ar pn 79and the argument 80.Ar arg 81is the argument given to 82.Fn puffs_nodewalk . 83.It Fn puffs_nodewalk pu nwfn arg 84Walk all nodes associted with the mountpoint 85.Ar pu 86and call 87.Fn nwfn 88for them. 89The walk is aborted if 90.Fn puffs_nodewalk_fn 91returns a value which is not 92.Dv NULL . 93This value is also returned this function. 94In case the whole set of nodes is traversed, 95.Dv NULL 96is returned. 97This function is useful for example in handling the 98.Fn puffs_fs_sync 99callback, when cached data for every node should be flushed to stable 100storage. 101.It Fn puffs_pn_remove pn 102Signal that a node has been removed from the file system, but do not 103yet release resources associated with the node. 104This will prevent the nodewalk functions from accessing the node. 105If necessary, this is usually called from 106.Fn puffs_node_remove 107and 108.Fn puffs_node_rmdir . 109.It Fn puffs_pn_put pn 110Free all resources associated with node 111.Ar pn . 112This is typically called from 113.Fn puffs_node_reclaim . 114.Pp 115.El 116.Sh SEE ALSO 117.Xr puffs 3 118