1 .\" $NetBSD: puffs_ops.3,v 1.42 2015/02/16 10:48:56 wiz Exp $
3 .\" Copyright (c) 2007 Antti Kantee. 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.
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
31 .Nd puffs callback operations
38 .Fa "struct puffs_usermount *pu" "struct statvfs *sbp"
42 .Fa "struct puffs_usermount *pu" "int waitfor" "const struct puffs_cred *pcr"
46 .Fa "struct puffs_usermount *pu" "void *fid" "size_t fidsize"
47 .Fa "struct puffs_newinfo *pni"
51 .Fa "struct puffs_usermount *pu" "puffs_cookie_t cookie" "void *fid"
55 .Fo puffs_fs_extattrctl
56 .Fa "struct puffs_usermount *pu" "int cmd" "puffs_cookie_t cookie" "int flags"
57 .Fa "int attrnamespace" "const char *attrname"
61 .Fa "struct puffs_usermount *pu" "int flags"
65 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc"
66 .Fa "struct puffs_newinfo *pni" "const struct puffs_cn *pcn"
70 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc"
71 .Fa "struct puffs_newinfo *pni" "const struct puffs_cn *pcn"
72 .Fa "const struct vattr *vap"
76 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc"
77 .Fa "struct puffs_newinfo *pni" "const struct puffs_cn *pcn"
78 .Fa "const struct vattr *vap"
82 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "int mode"
83 .Fa "const struct puffs_cred *pcr"
87 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "int modep"
88 .Fa "const struct puffs_cred *pcr" "int *oflags"
92 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "int flags"
93 .Fa "const struct puffs_cred *pcr"
97 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "int mode"
98 .Fa "const struct puffs_cred *pcr"
101 .Fo puffs_node_getattr
102 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "struct vattr *vap"
103 .Fa "const struct puffs_cred *pcr"
106 .Fo puffs_node_setattr
107 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "const struct vattr *vap"
108 .Fa "const struct puffs_cred *pcr"
111 .Fo puffs_node_getattr_ttl
112 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "struct vattr *vap"
113 .Fa "const struct puffs_cred *pcr" "struct timespec *va_ttl"
116 .Fo puffs_node_setattr_ttl
117 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "const struct vattr *vap"
118 .Fa "const struct puffs_cred *pcr" "struct timespec *va_ttl" "int xflag"
122 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "int *events"
126 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "int flags"
127 .Fa "const struct puffs_cred *pcr"
131 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc"
132 .Fa "const struct puffs_cred *pcr" "int flags" "off_t offlo" "off_t offhi"
136 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "off_t oldoff"
137 .Fa "off_t newoff" "const struct puffs_cred *pcr"
140 .Fo puffs_node_remove
141 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "puffs_cookie_t targ"
142 .Fa "const struct puffs_cn *pcn"
146 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "puffs_cookie_t targ"
147 .Fa "const struct puffs_cn *pcn"
150 .Fo puffs_node_rename
151 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "puffs_cookie_t src"
152 .Fa "const struct puffs_cn *pcn_src" "puffs_cookie_t targ_dir"
153 .Fa "puffs_cookie_t targ" "const struct puffs_cn *pcn_targ"
157 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc"
158 .Fa "struct puffs_newinfo *pni" "const struct puffs_cn *pcn"
159 .Fa "const struct vattr *vap"
163 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "puffs_cookie_t targ"
164 .Fa "const struct puffs_cn *pcn"
167 .Fo puffs_node_readdir
168 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "struct dirent *dent"
169 .Fa "off_t *readoff" "size_t *reslen" "const struct puffs_cred *pcr"
170 .Fa "int *eofflag" "off_t *cookies" "size_t *ncookies"
173 .Fo puffs_node_symlink
174 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc"
175 .Fa "struct puffs_newinfo *pni"
176 .Fa "const struct puffs_cn *pcn_src" "const struct vattr *vap"
177 .Fa "const char *link_target"
180 .Fo puffs_node_readlink
181 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc"
182 .Fa "const struct puffs_cred *pcr" "char *link" "size_t *linklen"
186 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "uint8_t *buf"
187 .Fa "off_t offset" "size_t *resid" "const struct puffs_cred *pcr" "int ioflag"
191 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "uint8_t *buf"
192 .Fa "off_t offset" "size_t *resid" "const struct puffs_cred *pcr" "int ioflag"
195 .Fo puffs_node_write2
196 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "uint8_t *buf"
197 .Fa "off_t offset" "size_t *resid" "const struct puffs_cred *pcr" "int ioflag"
201 .Fo puffs_node_abortop
202 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc"
203 .Fa "const struct puffs_cn *pcn"
206 .Fo puffs_node_getextattr
207 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "int attrnamespace"
208 .Fa "const char *attrname" "size_t *attrsize" "uint8_t *attr" "size_t *resid"
209 .Fa "const struct puffs_cred *pcr"
212 .Fo puffs_node_setextattr
213 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "int attrnamespace"
214 .Fa "const char *attrname" "uint8_t *attr" "size_t *resid"
215 .Fa "const struct puffs_cred *pcr"
218 .Fo puffs_node_listextattr
219 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "int attrnamespace"
220 .Fa "size_t *attrssize" "uint8_t *attrs" "iint flag" "size_t *resid"
221 .Fa "const struct puffs_cred *pcr"
224 .Fo puffs_node_deleteextattr
225 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "int attrnamespace"
226 .Fa "const char *attrname"
227 .Fa "const struct puffs_cred *pcr"
230 .Fo puffs_node_fallocate
231 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "off_t pos" "off_t len"
234 .Fo puffs_node_fdiscard
235 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "off_t pos" "off_t len"
239 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc"
242 .Fo puffs_node_reclaim
243 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc"
246 .Fo puffs_node_reclaim2
247 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc" "int nlookup"
250 .Fo puffs_node_inactive
251 .Fa "struct puffs_usermount *pu" "puffs_cookie_t opc"
254 .Fn puffs_setback "struct puffs_cc *pcc" "int op"
256 .Fn puffs_newinfo_setcookie "struct puffs_newinfo *pni" "puffs_cookie_t cookie"
258 .Fn puffs_newinfo_setvtype "struct puffs_newinfo *pni" "enum vtype vtype"
260 .Fn puffs_newinfo_setsize "struct puffs_newinfo *pni" "voff_t size"
262 .Fn puffs_newinfo_setrdev "struct puffs_newinfo *pni" "dev_t rdev"
264 .Fn puffs_newinfo_setva "struct puffs_newinfo *pni" "struct vattr *vap"
266 .Fn puffs_newinfo_setvattl "struct puffs_newinfo *pni" "struct timespec *va_ttl"
268 .Fn puffs_newinfo_setcnttl "struct puffs_newinfo *pni" "struct timespec *cn_ttl"
272 requires to function can be divided into two categories: file system
273 callbacks and node callbacks.
274 The former affect the entire file system while the latter are targeted
275 at a file or a directory and a file.
276 They are roughly equivalent to the vfs and vnode operations in the
279 All callbacks can be prototyped with the file system name and operation
281 .Fn PUFFSOP_PROTOS fsname .
282 .Ss File system callbacks (puffs_fs)
284 .It Fn puffs_fs_statvfs "pu" "sbp"
285 The following fields of the argument
289 * unsigned long f_bsize; file system block size
290 * unsigned long f_frsize; fundamental file system block size
291 * fsblkcnt_t f_blocks; number of blocks in file system,
292 * (in units of f_frsize)
294 * fsblkcnt_t f_bfree; free blocks avail in file system
295 * fsblkcnt_t f_bavail; free blocks avail to non-root
296 * fsblkcnt_t f_bresvd; blocks reserved for root
298 * fsfilcnt_t f_files; total file nodes in file system
299 * fsfilcnt_t f_ffree; free file nodes in file system
300 * fsfilcnt_t f_favail; free file nodes avail to non-root
301 * fsfilcnt_t f_fresvd; file nodes reserved for root
304 .It Fn puffs_fs_sync "pu" "waitfor" "pcr"
305 All the dirty buffers that have been cached at the file server
306 level including metadata should be committed to stable storage.
309 parameter affects the operation.
311 .Bl -tag -width XMNT_NOWAITX
313 Wait for all I/O for complete until returning.
315 Initiate I/O, but do not wait for completion.
317 Synchorize data not synchoronized by the file system syncer,
318 i.e., data not written when
324 The credentials for the initiator of the sync operation are present in
326 and will usually be either file system or kernel credentials, but might
327 also be user credentials.
328 However, most of the time it is advisable to sync regardless of the
329 credentials of the caller.
330 .It Fn puffs_fs_fhtonode "pu" "fid" "fidsize" "pni"
331 Translates a file handle
336 indicates how large the file handle is.
337 In case the file system's handles are static length, this parameter can
338 be ignored as the kernel guarantees all file handles passed to the file
339 server are of correct length.
340 For dynamic length handles the field should be examined and
342 returned in case the file handle length is not correct.
344 This function provides essentially the same information to the kernel as
345 .Fn puffs_node_lookup .
346 The information is necessary for creating a new vnode corresponding to
348 .It Fn puffs_fs_nodetofh "pu" "cookie" "fid" "fidsize"
349 Create a file handle from the node described by
351 The file handle should contain enough information to reliably identify
352 the node even after reboots and the pathname/inode being replaced by
354 If this is not possible, it is up to the author of the file system to
355 act responsibly and decide if the file system can support file handles
358 For file systems which want dynamic length file handles, this function
359 must check if the file handle space indicated by
361 is large enough to accommodate the file handle for the node.
362 If not, it must fill in the correct size and return
364 In either case, the handle length should be supplied to the kernel in
366 File systems with static length handles can ignore the size parameter as
367 the kernel always supplies the correct size buffer.
368 .It Fn puffs_fs_unmount "pu" "flags"
369 Unmount the file system.
370 The kernel has assumedly flushed all cached data when this callback
372 If the file system cannot currently be safely be unmounted, for whatever
373 reason, the kernel will honor an error value and not forcibly unmount.
376 is not honored by the file server, the kernel will forcibly unmount
380 These operations operate in the level of individual files.
381 The file cookie is always provided as the second argument
383 If the operation is for a file, it will be the cookie of the file.
384 The case the operation involves a directory (such as
385 .Dq create file in directory ) ,
386 the cookie will be for the directory.
387 Some operations take additional cookies to describe the rest of
389 The return value 0 signals success, else an appropriate errno value
391 Please note that neither this list nor the descriptions are complete.
393 .It Fn puffs_node_lookup "pu" "opc" "pni" "pcn"
394 This function is used to locate nodes, or in other words translate
395 pathname components to file system data structures.
396 The implementation should match the name in
398 against the existing entries in the directory provided by the cookie
400 If found, the cookie for the located node should be set in
403 .Fn puffs_newinfo_setcookie .
404 Additionally, the vnode type and size (latter applicable to regular files only)
406 .Fn puffs_newinfo_setvtype
408 .Fn puffs_newinfo_setsize ,
410 If the located entry is a block device or character device file,
411 the dev_t for the entry should be set using
412 .Fn puffs_newinfo_setrdev .
417 .Dv PUFFS_KFLAG_CACHE_FS_TTL
419 .Fn puffs_newinfo_setva ,
420 .Fn puffs_newinfo_setvattl ,
422 .Fn puffs_newinfo_setcnttl
423 can be called to specify the new node attributes, cached attributes
424 time to live, and cached name time to live.
426 The type of operation is found from
427 .Va pcn-\*[Gt]pcn_nameiop :
428 .Bl -tag -width XNAMEI_LOOKUPX
430 Normal lookup operation.
432 Lookup to create a node.
434 Lookup for node deletion.
436 Lookup for the target of a rename operation (source will be looked
441 The final component from a pathname lookup usually requires special
443 It can be identified by looking at the
444 .Va pcn-\*[Gt]pcn_flags
446 .Dv PUFFSLOOKUP_ISLASTCN .
447 For example, in most cases the lookup operation will want to check if
448 a delete, rename or create operation has enough credentials to perform
451 The return value 0 signals a found node and a nonzero value signals
455 signals "success" for cases where the lookup operation is
459 Failure in these cases can be signalled by returning another appropriate
460 error code, for example
463 Usually a null-terminated string for the next pathname component is
465 .Ar pcn-\*[Gt]pcn_name .
466 In case the file system is using the option
467 .Dv PUFFS_KFLAG_LOOKUP_FULLPNBUF ,
468 the remainder of the complete pathname under lookup is found in
470 .Ar pcn-\*[Gt]pcn_namelen
471 always specifies the length of the next component.
472 If operating with a full path, the file system is allowed to consume
473 more than the next component's length in node lookup.
474 This is done by setting
475 .Ar pcn-\*[Gt]pcn_consume
476 to indicate the amount of
478 characters in addition to
479 .Ar pcn-\*[Gt]pcn_namelen
481 .It Fn puffs_node_create "pu" "opc" "pni" "pcn" "va"
482 .It Fn puffs_node_mkdir "pu" "opc" "pni" "pcn" "va"
483 .It Fn puffs_node_mknod "pu" "opc" "pni" "pcn" "va"
484 A file node is created in the directory denoted by the cookie
486 by any of the above callbacks.
487 The name of the new file can be found from
489 and the attributes are specified by
491 and the cookie for the newly created node should be set in
493 The only difference between these three is that they create a regular
494 file, directory and device special file, respectively.
496 In case of mknod, the device identifier can be found in
497 .Fa va-\*[Gt]va_rdev .
498 .It Fn puffs_node_open "pu" "opc" "mode" "pcr"
499 .It Fn puffs_node_open2 "pu" "opc" "mode" "pcr" "oflags"
500 Open the node denoted by the cookie
504 specifies the flags that
506 was called with, e.g.
511 allows the file system to pass back information for the file in
513 The only implemented flag for now is
514 .Dv PUFFS_OPEN_IO_DIRECT
515 that cause file read/write to bypass the page cache.
516 .It Fn puffs_node_close "pu" "opc" "flags" "pcr"
520 parameter describes the flags that the file was opened with.
521 .It Fn puffs_node_access "pu" "opc" "mode" "pcr"
522 Check if the credentials of
524 have the right to perform the operation specified by
530 can specify read, write or execute by
536 .It Fn puffs_node_getattr "pu" "opc" "va" "pcr"
537 The attributes of the node specified by
539 must be copied to the space pointed by
541 .It Fn puffs_node_getattr_ttl "pu" "opc" "va" "pcr" "va_ttl"
543 .Fn puffs_node_getattr
544 with cached attribute time to live specified in
546 .It Fn puffs_node_setattr "pu" "opc" "va" "pcr"
547 The attributes for the node specified by
549 must be set to those contained in
553 which contain a value different from
555 (typecast to the field's type!) contain a valid value.
556 .It Fn puffs_node_setattr_ttl "pu" "opc" "va" "pcr" "va_ttl" "xflag"
558 .Fn puffs_node_setattr
559 with cached attribute time to live specified in
561 .Dv PUFFS_SETATTR_FAF
564 for Fire-And-Forget operations.
565 .It Fn puffs_node_poll "pu" "opc" "events"
566 Poll for events on node
572 are available, the function should set the bitmask to match available
573 events and return immediately.
574 Otherwise, the function should block (yield) until some events in
576 become available and only then set the
580 In case this function returns an error,
584 equivalent) will be delivered to the calling process.
587 The system call interface for
589 contains a timeout parameter.
590 At this level, however, the timeout is not supplied.
591 In case input does not arrive, the file system should periodically
592 unblock and return 0 new events to avoid hanging forever.
593 This will hopefully be better supported by libpuffs in the future.
594 .It Fn puffs_node_mmap "pu" "opc" "flags" "pcr"
595 Called when a regular file is being memory mapped by
598 is currently always 0.
599 .It Fn puffs_node_fsync "pu" "opc" "pcr" "flags" "offlo" "offhi"
600 Sychronize a node's contents onto stable storage.
601 This is necessary only if the file server caches some information
602 before committing it.
605 specifies the minimum level of sychronization required (XXX: they are
611 specify the data offsets requiring to be synced.
612 A high offset of 0 means sync from
614 to the end of the file.
615 .It Fn puffs_node_seek "pu" "opc" "oldoff" "newoff" "pcr"
618 is seekable to the location
622 specifies the offset we are starting the seek from.
623 Most file systems dealing only with regular will choose to not
625 However, it is useful for example in cases where files are
627 .It Fn puffs_node_remove "pu" "opc" "targ" "pcn"
628 .It Fn puffs_node_rmdir "pu" "opc" "targ" "pcn"
631 from the directory indicated by
633 The directory entry name to be removed is provided by
635 The rmdir operation removes only directories, while the remove
636 operation removes all other types except directories.
638 It is paramount to note that the file system may not remove the
639 node data structures at this point, only the directory entry and prevent
640 lookups from finding the node again.
641 This is to retain the
644 The data may be removed only when
645 .Fn puffs_node_reclaim
647 .Fn puffs_node_reclaim2
648 is called for the node, as this assures there are no further users.
649 .It Fn puffs_node_link "pu" "opc" "targ" "pcn"
650 Create a hard link for the node
656 provides the directory entry name for the new link.
657 .It Fn puffs_node_rename "pu" "src_dir" "src" "pcn_src" "targ_dir" "targ" "pcn_targ"
660 with the name specified by
664 The target directory and target name are given by
670 the target node already exists, it is specified by
672 and must be replaced atomically.
678 It is legal to replace a directory node by another directory node with
679 the means of rename if the target directory is empty, otherwise
682 All other types can replace all other types.
683 In case a rename between incompatible types is attempted, the errors
687 should be returned, depending on the target type.
688 .It Fn puffs_node_readdir "pu" "opc" "dent" "readoff" "reslen" "pcr" "eofflag" "cookies" "ncookies"
689 To read directory entries,
690 .Fn puffs_node_readdir
692 It should store directories as
694 in the space pointed to by
696 The amount of space available is given by
698 and before returning it should be set to the amount of space
703 is used to specify the offset to the directory.
704 Its intepretation is up to the file system and it should be set to
705 signal the continuation point when there is no more room for the next
708 It is most performant to return the maximal amount of directory
710 It is easiest to generate directory entries by using
712 which also automatically advances the necessary pointers.
714 In case end-of-directory is reached,
716 should be set to one.
717 Note that even a new call to readdir may start where
719 points to end-of-directory.
721 If the file system supports file handles, the arguments
727 is a vector for offsets corresponding to read offsets.
728 One cookie should be filled out for each directory entry.
729 The value of the cookie should equal the offset of the
731 directory entry, i.e., which offset should be passed to readdir for
732 the first entry read to be the entry following the current one.
734 is the number of slots for cookies in the cookie vector upon entry to
735 the function and must be set to the amount of cookies stored in the
736 vector (i.e., amount of directory entries read) upon exit.
737 There is always enough space in the cookie vector for the maximal number
738 of entries that will fit into the directory entry buffer.
739 For filling out the vector, the helper function
740 .Fn PUFFS_STORE_DCOOKIE cookies ncookies offset
742 This properly checks against
748 must be initialized to zero before the first call to
749 .Fn PUFFS_STORE_DCOOKIE .
750 .It Fn puffs_node_symlink "pu" "opc" "pni" "pcn_src" "va" "link_target"
751 Create a symbolic link into the directory
755 and the initial attributes in
759 contains a null-terminated string for the link target.
760 The created node cookie should be set in
762 .It Fn puffs_node_readlink "pu" "opc" "pcr" "link" "linklen"
763 Read the target of a symbolic link
765 The result is placed in the buffer pointed to by
767 This buffer's length is given in
769 and it must be updated to reflect the real link length.
770 A terminating nul character should not be put into the buffer and
772 be included in the link length.
773 .It Fn puffs_node_read "pu" "opc" "buf" "offset" "resid" "pcr" "ioflag"
774 Read the contents of a file
776 It will gather the data from
778 in the file and read the number
781 The buffer is guaranteed to have this much space.
782 The amount of data requested by
784 should be read, except in the case of eof-of-file or an error.
787 should be set to indicate the amount of request NOT completed.
788 In the normal case this should be 0.
789 .It Fn puffs_node_write "pu" "opc" "buf" "offset" "resid" "pcr" "ioflag"
790 .It Fn puffs_node_write2 "pu" "opc" "buf" "offset" "resid" "pcr" "ioflag" \
793 writes data to a file
797 and extend the file if necessary.
798 The number of octets written is indicated by
800 everything must be written or an error will be generated.
801 The parameter must be set to indicate the amount of data NOT written.
804 is specified, the data should be appended to the end of the file.
805 .Fn puffs_node_write2
806 serves the same purpose as
812 is set for Fire-And-Forget operations.
813 .It Fn puffs_node_fallocate "pu" "opc" "pos" "len"
816 bytes of backing store at offset
818 for the node referenced by the cookie
820 .It Fn puffs_node_fdiscard "pu" "opc" "pos" "len"
823 bytes of backing store (creating a hole) at offset
825 for the node referenced by the cookie
827 .It Fn puffs_node_print "pu" "opc"
828 Print information about node.
829 This is used only for kernel-initiated diagnostic purposes.
830 .It Fn puffs_node_reclaim "pu" "opc"
831 The kernel will no longer reference the cookie and resources associated
832 with it may be freed.
835 has a link count of zero, it may be safely removed now.
836 .It Fn puffs_node_reclaim2 "pu" "opc" "nlookup"
838 .Fn puffs_node_reclaim
839 with an addditional argument for the number of lookups that have been done
840 on the node (Node creation is counted as a lookup). This can be used by the
841 file system to avoid a race condition, where the kernel sends a reclaim
842 while it does not have received the reply for a lookup.
843 If the file system tracks lookup count, and compares to
845 it can detect this situation and ignore the reclaim.
847 If the file system maps cookies to
848 .Vt struct puffs_node
849 then the framework will do that work, and
850 .Fn puffs_node_reclaim
851 can be reliabily used without the race condition.
852 .It Fn puffs_node_abortop "pu" "opc" "pcn"
853 In case the operation following lookup (e.g., mkdir or remove) is not
854 executed for some reason, abortop will be issued.
855 This is useful only for servers which cache state between lookup
856 and a directory operation and is generally left unimplemented.
857 .It Fn puffs_node_inactive "pu" "opc"
860 has lost its last reference in the kernel.
861 However, the cookie must still remain valid until
862 .Fn puffs_node_reclaim
864 .Fn puffs_node_reclaim2
866 .It Fn puffs_setback "pcc" "op"
867 Issue a "setback" operation which will be handled when the request response
868 is returned to the kernel.
869 Currently this can be only called from mmap, open, remove and rmdir.
870 The valid parameters for
873 .Dv PUFFS_SETBACK_INACT_N1
875 .Dv PUFFS_SETBACK_INACT_N2 .
876 These signal that a file system mounted with
877 .Dv PUFFS_KFLAG_IAONDEMAND
878 should call the file system inactive method for the specified node.
879 The node number 1 always means the operation cookie
881 while the node number 2 can be used to specify the second node argument
882 present in some methods, e.g., remove.
883 .It Fn puffs_newinfo_setcookie pni cookie
884 Set cookie for node provided by this method to
886 .It Fn puffs_newinfo_setvtype pni vtype
887 Set the type of the newly located node to
889 This call is valid only for
893 .It Fn puffs_newinfo_setsize pni size
894 Set the size of the newly located node to
896 If left unset, the value defaults to 0.
897 This call is valid only for
901 .It Fn puffs_newinfo_setrdev pni rdev
902 Set the type of the newly located node to
904 This call is valid only for
908 producing device type nodes.
909 .It Fn puffs_newinfo_setva pni vap
910 Set the attributes for newly created vnode.
911 This call is valid for
921 .Dv PUFFS_KFLAG_CACHE_FS_TTL
923 .It Fn puffs_newinfo_setvattl pni va_ttl
924 Set cached attribute time to live for newly created vnode.
925 This call is valid for
935 .Dv PUFFS_KFLAG_CACHE_FS_TTL
937 .It Fn puffs_newinfo_setcnttl pni cn_ttl
938 Set cached name time to live for newly created vnode.
939 This call is valid for
949 .Dv PUFFS_KFLAG_CACHE_FS_TTL