1 .\" $NetBSD: virtdir.3,v 1.1 2007/04/15 15:10:57 agc Exp $
3 .\" Copyright © 2007 Alistair Crooks. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
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 .\" 3. The name of the author may not be used to endorse or promote
14 .\" products derived from this software without specific prior written
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
18 .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
21 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 .\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 .\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 .Nd Utility routines for virtual directories for refuse operations
39 .Fa "virtdir_t *tree" "struct stat *dir" "struct stat *file" "struct stat *symlink"
43 .Fa "virtdir_t *tree" "const char *name" "size_t namesize" "uint8_t type" "char *target"
47 .Fa "virtdir_t *tree" "const char *name" "size_t namesize"
51 .Fa "virtdir_t *tree" "const char *name" "size_t namesize"
55 .Fa "virtdir_t *tree" "const char *name" "size_t namesize"
63 .Fa "virtdir_t *tree" "const char *directory"
75 provides virtual directory functionality for the benefit of
77 file systems (and also for FUSE-based file systems).
79 It uses the framework provided by the
81 subsystem, and, through that, the kernel interface provided by
86 routines build up and manage a list of virtual directory entries.
87 Each virtual directory entry is indexed by its full pathname within
89 This is consistent with the way that
91 locates directory entries - by full pathname.
93 The list of paths is sorted alphabetically.
94 Each of these virtual directory entries has a distinct type -
101 Additionally, an entry can point to a target - this
102 is useful when modeling virtual directory entries which are
104 The list contains three basic
106 structures, which contain basic information for file, directory
107 and symbolic link entries.
108 This information can be specified at
109 initialization time, and customized within the individual
110 getattr operation routines as specified by the
111 individual file systems.
114 functionality can also make virtual directory entries available
115 on a per-directory basis
116 to the caller by means of routines analogous to
132 An unsupported experimental version of
137 .An Alistair Crooks Aq agc@NetBSD.org