1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
.\" $NetBSD: refuse.3,v 1.15 2019/04/11 06:18:43 wiz Exp $
.\"
.\" Copyright © 2007 Alistair Crooks. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote
.\" products derived from this software without specific prior written
.\" permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd April 11, 2019
.Dt REFUSE 3
.Os
.Sh NAME
.Nm refuse
.Nd Re-implementation of a file system in userspace system
.Sh LIBRARY
.Lb librefuse
.Sh SYNOPSIS
.In fuse.h
.Ft int
.Fo fuse_main
.Fa "int argc" "char **argv" "const struct fuse_operations *"
.Fc
.Ft struct fuse_args
.Fo FUSE_ARGS_INIT
.Fa "int argc" "char **argv"
.Fc
.Ft struct fuse_opt
.Fo FUSE_OPT_KEY
.Fa "const char* templ" "int32_t key"
.Fc
.Vt struct fuse_opt Dv FUSE_OPT_END ;
.Vt int32_t Dv FUSE_OPT_KEY_OPT ;
.Vt int32_t Dv FUSE_OPT_KEY_NONOPT ;
.Vt int32_t Dv FUSE_OPT_KEY_KEEP ;
.Vt int32_t Dv FUSE_OPT_KEY_DISCARD ;
.Ft int
.Fo fuse_opt_add_arg
.Fa "struct fuse_args *args" "const char *arg"
.Fc
.Ft int
.Fo fuse_opt_add_opt
.Fa "char **opts" "const char *opt"
.Fc
.Ft int
.Fo fuse_opt_add_opt_escaped
.Fa "char **opts" "const char *opt"
.Fc
.Ft void
.Fo fuse_opt_free_args
.Fa "struct fuse_args *args"
.Fc
.Ft int
.Fo fuse_opt_insert_arg
.Fa "struct fuse_args *args" "int pos" "const char *arg"
.Fc
.Ft int
.Fo fuse_opt_match
.Fa "const struct fuse_opt *opts" "const char *opt"
.Fc
.Ft int
.Fo fuse_opt_parse
.Fa "struct fuse_args *args" "void *userdata"
.Fa "const struct fuse_opt *descriptions" "fuse_opt_proc_t processingfunc"
.Fc
.Ft int
.Fo fuse_new
.Fa "struct fuse_args *args" "const struct fuse_operations *ops"
.Fa "size_t opssize" "void *userdata"
.Fc
.Ft int
.Fo fuse_mount
.Fa "struct fuse *fuse" "const char *mountpoint"
.Fc
.Ft int
.Fo fuse_unmount
.Fa "struct fuse* fuse"
.Fc
.Ft int
.Fo fuse_daemonize
.Fa "struct fuse *fuse"
.Fc
.Ft int
.Fo fuse_version
.Fa "struct fuse *fuse"
.Fc
.Ft int
.Fo puffs_fuse_node_getattr
.Fa "const char *path" "struct stat *attrs"
.Fc
.Ft int
.Fo puffs_fuse_node_readlink
.Fa "const char *path" "char *output" "size_t outlen"
.Fc
.Ft int
.Fo puffs_fuse_node_mknod
.Fa "const char *path" "mode_t permissions" "dev_t devicenumber"
.Fc
.Ft int
.Fo puffs_fuse_node_mkdir
.Fa "const char *path" "mode_t permissions"
.Fc
.Ft int
.Fo puffs_fuse_unlink
.Fa "const char *path"
.Fc
.Ft int
.Fo puffs_fuse_node_rmdir
.Fa "const char *path"
.Fc
.Ft int
.Fo puffs_fuse_node_symlink
.Fa "const char *path" "const char *target"
.Fc
.Ft int
.Fo puffs_fuse_node_rename
.Fa "const char *from" "const char *to"
.Fc
.Ft int
.Fo puffs_fuse_node_link
.Fa "const char *from" "const char *to"
.Fc
.Ft int
.Fo puffs_fuse_node_chmod
.Fa "const char *path" "mode_t permissions"
.Fc
.Ft int
.Fo puffs_fuse_node_own
.Fa "const char *path" "uid_t owner" "gid_t group"
.Fc
.Ft int
.Fo puffs_fuse_node_truncate
.Fa "const char *path" "off_t newsize"
.Fc
.Ft int
.Fo puffs_fuse_node_utime
.Fa "const char *path" "struct utimbuf *newtimes"
.Fc
.Ft int
.Fo puffs_fuse_node_open
.Fa "const char *path" "struct fuse_file_info *fileinfo"
.Fc
.Ft int
.Fo puffs_fuse_node_read
.Fa "const char *path" "char *buffer" "size_t bufferlen" "off_t startoffset"
.Fa "struct fuse_file_info *fileinfo"
.Fc
.Ft int
.Fo puffs_fuse_node_write
.Fa "const char *path" "char *buffer" "size_t bufferlen" "off_t startoffset"
.Fa "struct fuse_file_info *fileinfo"
.Fc
.Ft int
.Fo puffs_fuse_fs_statfs
.Fa "const char *path" "struct statvfs *vfsinfo"
.Fc
.Ft int
.Fo puffs_fuse_node_flush
.Fa "const char *path" "struct fuse_file_info *fileinfo"
.Fc
.Ft int
.Fo puffs_fuse_node_fsync
.Fa "const char *path" "int flags" "struct fuse_file_info *fileinfo"
.Fc
.Ft int
.Fo puffs_fuse_node_setxattr
.Fa "const char *path" "const char *attrname" "const char *attrvalue"
.Fa "size_t attrsize" "int flags"
.Fc
.Ft int
.Fo puffs_fuse_node_getxattr
.Fa "const char *path" "const char *attrname" "const char *attrvalue"
.Fa "size_t attrvaluesize"
.Fc
.Ft int
.Fo puffs_fuse_node_listxattr
.Fa "const char *path" "const char *attrname"
.Fa "size_t attrvaluesize"
.Fc
.Ft int
.Fo puffs_fuse_node_removexattr
.Fa "const char *path" "const char *attrname"
.Fc
.Ft int
.Fo puffs_fuse_node_opendir
.Fa "const char *path" "struct fuse_file_info *fileinfo"
.Fc
.Ft int
.Fo puffs_fuse_node_readdir
.Fa "const char *path" "void *data" "fuse_fill_dir_t fillinfo"
.Fa "off_t offset" "struct fuse_file_info *fileinfo"
.Fc
.Ft int
.Fo puffs_fuse_node_releasedir
.Fa "const char *path" "struct fuse_file_info *fileinfo"
.Fc
.Ft int
.Fo puffs_fuse_node_fsyncdir
.Fa "const char *path" "int flags" "struct fuse_file_info *fileinfo"
.Fc
.Ft void *
.Fo puffs_fuse_fs_init
.Fa "struct fuse_conn_info *connectioninfo"
.Fc
.Ft void
.Fo puffs_fuse_node_destroy
.Fa "void *connection"
.Fc
.Ft int
.Fo puffs_fuse_node_access
.Fa "const char *path" "int accesstype"
.Fc
.Ft int
.Fo puffs_fuse_node_create
.Fa "const char *path" "mode_t permissions" "struct fuse_file_info *fileinfo"
.Fc
.Ft int
.Fo puffs_fuse_node_ftruncate
.Fa "const char *path" "off_t offset" "struct fuse_file_info *fileinfo"
.Fc
.Ft int
.Fo puffs_fuse_node_fgetattr
.Fa "const char *path" "struct stat *attrs" "struct fuse_file_info *fileinfo"
.Fc
.Ft int
.Fo puffs_fuse_node_lock
.Fa "const char *path" "struct fuse_file_info *fileinfo"
.Fa "int locktype" "struct flock *lockinfo"
.Fc
.Ft int
.Fo puffs_fuse_node_utimens
.Fa "const char *path" "const struct timespec *newtimes"
.Fc
.Ft int
.Fo puffs_fuse_node_bmap
.Fa "const char *path" "size_t mapsize" "uint64_t offset"
.Fc
.Sh DESCRIPTION
.Nm
is a reimplementation of the file system in user space subsystem.
Operations are transported from the kernel virtual file system layer
to the concrete implementation behind
.Nm ,
where they are processed and results are sent back to the kernel.
.Pp
It uses the framework provided by the
.Xr puffs 3
subsystem, and, through that, the kernel interface provided by
.Xr puffs 4 .
.Sh SEE ALSO
.Xr puffs 3 ,
.Xr puffs 4
.Rs
.%A Antti Kantee
.%A Alistair Crooks
.%D September 2007
.%J EuroBSDCon 2007
.%T ReFUSE: Userspace FUSE Reimplementation Using puffs
.Re
.Sh HISTORY
An unsupported experimental version of
.Nm
first appeared in
.Nx 5.0 .
.Sh AUTHORS
.An Alistair Crooks Aq Mt agc@NetBSD.org ,
.An Antti Kantee Aq Mt pooka@NetBSD.org
.Sh BUGS
Many, legion, but well-loved.
|