1.\" $NetBSD: vnodeops.9,v 1.70 2007/12/01 19:46:56 wiz Exp $ 2.\" 3.\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Gregory McGarry. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 3. All advertising materials mentioning features or use of this software 18.\" must display the following acknowledgement: 19.\" This product includes software developed by the NetBSD 20.\" Foundation, Inc. and its contributors. 21.\" 4. Neither the name of The NetBSD Foundation nor the names of its 22.\" contributors may be used to endorse or promote products derived 23.\" from this software without specific prior written permission. 24.\" 25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35.\" POSSIBILITY OF SUCH DAMAGE. 36.\" 37.Dd November 26, 2007 38.Dt VNODEOPS 9 39.Os 40.Sh NAME 41.Nm vnodeops , 42.Nm VOP_LOOKUP , 43.Nm VOP_CREATE , 44.Nm VOP_MKNOD , 45.Nm VOP_OPEN , 46.Nm VOP_CLOSE , 47.Nm VOP_ACCESS , 48.Nm VOP_GETATTR , 49.Nm VOP_SETATTR , 50.Nm VOP_READ , 51.Nm VOP_WRITE , 52.Nm VOP_IOCTL , 53.Nm VOP_FCNTL , 54.Nm VOP_POLL , 55.Nm VOP_KQFILTER , 56.Nm VOP_REVOKE , 57.Nm VOP_MMAP , 58.Nm VOP_FSYNC , 59.Nm VOP_SEEK , 60.Nm VOP_REMOVE , 61.Nm VOP_LINK , 62.Nm VOP_RENAME , 63.Nm VOP_MKDIR , 64.Nm VOP_RMDIR , 65.Nm VOP_SYMLINK , 66.Nm VOP_READDIR , 67.Nm VOP_READLINK , 68.Nm VOP_ABORTOP , 69.Nm VOP_INACTIVE , 70.Nm VOP_RECLAIM , 71.Nm VOP_LOCK , 72.Nm VOP_UNLOCK , 73.Nm VOP_ISLOCKED , 74.Nm VOP_BMAP , 75.Nm VOP_PRINT , 76.Nm VOP_PATHCONF , 77.Nm VOP_ADVLOCK , 78.Nm VOP_LEASE , 79.Nm VOP_WHITEOUT , 80.Nm VOP_GETPAGES , 81.Nm VOP_PUTPAGES , 82.Nm VOP_STRATEGY , 83.Nm VOP_BWRITE , 84.Nm VOP_GETEXTATTR , 85.Nm VOP_SETEXTATTR , 86.Nm VOP_LISTEXTATTR , 87.Nd vnode operations 88.Sh SYNOPSIS 89.In sys/param.h 90.In sys/buf.h 91.In sys/dirent.h 92.In sys/lock.h 93.In sys/vnode.h 94.In sys/mount.h 95.In sys/namei.h 96.In sys/unistd.h 97.In sys/fcntl.h 98.In sys/lockf.h 99.In sys/extattr.h 100.Ft int 101.Fn VOP_LOOKUP "struct vnode *dvp" "struct vnode **vpp" \ 102"struct componentname *cnp" 103.Ft int 104.Fn VOP_CREATE "struct vnode *dvp" "struct vnode **vpp" \ 105"struct componentname *cnp" "struct vattr *vap" 106.Ft int 107.Fn VOP_MKNOD "struct vnode *dvp" "struct vnode **vpp" \ 108"struct componentname *cnp" "struct vattr *vap" 109.Ft int 110.Fn VOP_OPEN "struct vnode *vp" "int mode" "kauth_cred_t cred" 111.Ft int 112.Fn VOP_CLOSE "struct vnode *vp" "int fflag" "kauth_cred_t cred" 113.Ft int 114.Fn VOP_ACCESS "struct vnode *vp" "int mode" "kauth_cred_t cred" 115.Ft int 116.Fn VOP_GETATTR "struct vnode *vp" "struct vattr *vap" "kauth_cred_t cred" 117.Ft int 118.Fn VOP_SETATTR "struct vnode *vp" "struct vattr *vap" "kauth_cred_t cred" 119.Ft int 120.Fn VOP_READ "struct vnode *vp" "struct uio *uio" "int ioflag" \ 121"kauth_cred_t cred" 122.Ft int 123.Fn VOP_WRITE "struct vnode *vp" "struct uio *uio" "int ioflag" \ 124"kauth_cred_t cred" 125.Ft int 126.Fn VOP_IOCTL "struct vnode *vp" "u_long command" "void *data" \ 127"int fflag" "kauth_cred_t cred" 128.Ft int 129.Fn VOP_FCNTL "struct vnode *vp" "u_int command" "void *data" \ 130"int fflag" "kauth_cred_t cred" 131.Ft int 132.Fn VOP_POLL "struct vnode *vp" "int events" 133.Ft int 134.Fn VOP_KQFILTER "struct vnode *vp" "struct knote *kn" 135.Ft int 136.Fn VOP_REVOKE "struct vnode *vp" "int flags" 137.Ft int 138.Fn VOP_MMAP "struct vnode *vp" "vm_prot_t prot" "kauth_cred_t cred" 139.Ft int 140.Fn VOP_FSYNC "struct vnode *vp" "kauth_cred_t cred" "int flags" \ 141"off_t offlo" "off_t offhi" 142.Ft int 143.Fn VOP_SEEK "struct vnode *vp" "off_t oldoff" "off_t newoff" \ 144"kauth_cred_t cred" 145.Ft int 146.Fn VOP_REMOVE "struct vnode *vp" "struct vnode *vp" \ 147"struct componentname *cnp" 148.Ft int 149.Fn VOP_LINK "struct vnode *dvp" "struct vnode *vp" \ 150"struct componentname *cnp" 151.Ft int 152.Fn VOP_RENAME "struct vnode *fdvp" "struct vnode *fvp" \ 153"struct componentname *fcnp" "struct vnode *tdvp" \ 154"struct vnode *tvp" "struct componentname *tcnp" 155.Ft int 156.Fn VOP_MKDIR "struct vnode *dvp" "struct vnode **vpp" \ 157"struct componentname *cnp" "struct vattr *vap" 158.Ft int 159.Fn VOP_RMDIR "struct vnode *dvp" "struct vnode *vp" \ 160"struct componentname *cnp" 161.Ft int 162.Fn VOP_SYMLINK "struct vnode *dvp" "struct vnode **vpp" \ 163"struct componentname *cnp" "struct vattr *vap" "char *target" 164.Ft int 165.Fn VOP_READDIR "struct vnode *vp" "struct uio *uio" \ 166"kauth_cred_t cred" "int *eofflag" "off_t **cookies" "int *ncookies" 167.Ft int 168.Fn VOP_READLINK "struct vnode *vp" "struct uio *uio" "kauth_cred_t cred" 169.Ft int 170.Fn VOP_ABORTOP "struct vnode *dvp" "struct componentname *cnp" 171.Ft int 172.Fn VOP_INACTIVE "struct vnode *vp" 173.Ft int 174.Fn VOP_RECLAIM "struct vnode *vp" 175.Ft int 176.Fn VOP_LOCK "struct vnode *vp" "int flags" 177.Ft int 178.Fn VOP_UNLOCK "struct vnode *vp" "int flags" 179.Ft int 180.Fn VOP_ISLOCKED "struct vnode *vp" 181.Ft int 182.Fn VOP_BMAP "struct vnode *vp" "daddr_t bn" "struct vnode **vpp" \ 183"daddr_t *bnp" "int *runp" 184.Ft int 185.Fn VOP_PRINT "struct vnode *vp" 186.Ft int 187.Fn VOP_PATHCONF "struct vnode *vp" "int name" "register_t *retval" 188.Ft int 189.Fn VOP_ADVLOCK "struct vnode *vp" "void *id" "int op" \ 190"struct flock *fl" "int flags" 191.Ft int 192.Fn VOP_LEASE "struct vnode *vp" "kauth_cred_t cred" \ 193"int flag" 194.Ft int 195.Fn VOP_WHITEOUT "struct vnode *dvp" "struct componentname *cnp" \ 196"int flags" 197.Ft int 198.Fn VOP_GETPAGES "struct vnode *vp" "voff_t offset" "struct vm_page **m" \ 199"int *count" "int centeridx" "vm_prot_t access_type" "int advice" "int flags" 200.Ft int 201.Fn VOP_PUTPAGES "struct vnode *vp" "voff_t offlo" "voff_t offhi" \ 202"int flags" 203.Ft int 204.Fn VOP_STRATEGY "struct vnode *vp" "struct buf *bp" 205.Ft int 206.Fn VOP_BWRITE "struct buf *bp" 207.Ft int 208.Fn VOP_GETEXTATTR "struct vnode *vp" "int attrnamespace" "const char *name" \ 209"struct uio *uio" "size_t *size" "kauth_cred_t cred" 210.Ft int 211.Fn VOP_SETEXTATTR "struct vnode *vp" "int attrnamespace" "const char *name" \ 212"struct uio *uio" "kauth_cred_t cred" 213.Ft int 214.Fn VOP_LISTEXTATTR "struct vnode *vp" "int attrnamespace" "struct uio *uio" \ 215"size_t *size" "kauth_cred_t cred" 216.Pp 217Not all header files are required for each function. 218.Sh DESCRIPTION 219The vnode operations vector describes what operations can be done to 220the file associated with the vnode. 221The system maintains one vnode operations vector for each file system 222type configured into the kernel. 223The vnode operations vector contains a pointer to a function for each 224operation supported by the file system. 225Many of the functions described in the vnode operations vector are 226closely related to their corresponding system calls. 227In most cases, they are called as a result of the system call 228associated with the operation being invoked. 229.Pp 230Functions in the vnode operations vector are invoked using specialized 231macros. 232The following table lists the elements of the vnode operations vector, 233the corresponding invocation macro, and a description of the element. 234.Pp 235.nf 236.ta \w'int (*vop_listextattr)()'u+2n +\w'VOP_LISTEXTATTR'u+2n +\w'Map file into user address space'u 237\fIVector element\fP \fIMacro\fP \fIDescription\fP 238.ta \w'int (*vop_listextattr)()'u+2n +\w'VOP_LISTEXTATTR'u+2n +\w'Map file into user address space'u+6nC 239.sp 5p 240int (*vop_lookup)() VOP_LOOKUP Lookup file name in name cache 241int (*vop_create)() VOP_CREATE Create a new file 242int (*vop_mknod)() VOP_MKNOD Make a new device 243int (*vop_open)() VOP_OPEN Open a file 244int (*vop_close)() VOP_CLOSE Close a file 245int (*vop_access)() VOP_ACCESS Determine file accessibility 246int (*vop_getattr)() VOP_GETATTR Get file attributes 247int (*vop_setattr)() VOP_SETATTR Set file attributes 248int (*vop_read)() VOP_READ Read from a file 249int (*vop_write)() VOP_WRITE Write to a file 250int (*vop_ioctl)() VOP_IOCTL Perform device-specific I/O 251int (*vop_fcntl)() VOP_FCNTL Perform file control 252int (*vop_poll)() VOP_POLL Test if poll event has occurred 253int (*vop_kqfilter)() VOP_KQFILTER Register a knote 254int (*vop_revoke)() VOP_REVOKE Eliminate vode activity 255int (*vop_mmap)() VOP_MMAP Map file into user address space 256int (*vop_fsync)() VOP_FSYNC Flush pending data to disk 257int (*vop_seek)() VOP_SEEK Test if file is seekable 258int (*vop_remove)() VOP_REMOVE Remove a file 259int (*vop_link)() VOP_LINK Link a file 260int (*vop_rename)() VOP_RENAME Rename a file 261int (*vop_mkdir)() VOP_MKDIR Make a new directory 262int (*vop_rmdir)() VOP_RMDIR Remove a directory 263int (*vop_symlink)() VOP_SYMLINK Create a symbolic link 264int (*vop_readdir)() VOP_READDIR Read directory entry 265int (*vop_readlink)() VOP_READLINK Read contents of a symlink 266int (*vop_abortop)() VOP_ABORTOP Abort pending operation 267int (*vop_inactive)() VOP_INACTIVE Release the inactive vnode 268int (*vop_reclaim)() VOP_RECLAIM Reclaim vnode for another file 269int (*vop_lock)() VOP_LOCK Sleep until vnode lock is free 270int (*vop_unlock)() VOP_UNLOCK Wake up process sleeping on lock 271int (*vop_islocked)() VOP_ISLOCKED Test if vnode is locked 272int (*vop_bmap)() VOP_BMAP Logical block number conversion 273int (*vop_print)() VOP_PRINT Print debugging information 274int (*vop_pathconf)() VOP_PATHCONF Return POSIX pathconf data 275int (*vop_advlock)() VOP_ADVLOCK Advisory record locking 276int (*vop_lease)() VOP_LEASE Validate vnode credentials 277int (*vop_whiteout)() VOP_WHITEOUT Whiteout vnode 278int (*vop_getpages)() VOP_GETPAGES Read VM pages from file 279int (*vop_putpages)() VOP_PUTPAGES Write VM pages to file 280int (*vop_strategy)() VOP_STRATEGY Read/write a file system buffer 281int (*vop_bwrite)() VOP_BWRITE Write a file system buffer 282int (*vop_getextattr)() VOP_GETEXTATTR Get extended attribute 283int (*vop_setextattr)() VOP_SETEXTATTR Set extended attribute 284int (*vop_listextattr)() VOP_LISTEXTATTR List extended attributes 285.fi 286.Pp 287The implementation details of the vnode operations vector are not 288quite what is described here. 289.Pp 290If the file system type does not support a specific operation, it must 291nevertheless assign an appropriate function in the vnode operations 292vector to do the minimum required of it. 293In most cases, such functions either do nothing or return an error 294value to the effect that it is not supported. 295.Pp 296Many of the functions in the vnode operations vector take a 297componentname structure. 298It is used to encapsulate many parameters into a single function 299argument. 300It has the following structure: 301.Bd -literal 302struct componentname { 303 /* 304 * Arguments to lookup. 305 */ 306 u_long cn_nameiop; /* namei operation */ 307 u_long cn_flags; /* flags to namei */ 308 struct lwp *cn_lwp; /* lwp requesting lookup */ 309 kauth_cred_t cn_cred; /* credentials */ 310 /* 311 * Shared between lookup and commit routines. 312 */ 313 char *cn_pnbuf; /* pathname buffer */ 314 const char *cn_nameptr; /* pointer to looked up name */ 315 long cn_namelen; /* length of looked up component */ 316 u_long cn_hash; /* hash value of looked up name */ 317 long cn_consume; /* chars to consume in lookup() */ 318}; 319.Ed 320.Pp 321The top half of the structure is used exclusively for the pathname 322lookups using 323.Fn VOP_LOOKUP 324and is initialized by the caller. 325The semantics of the lookup are affected by the lookup operation 326specified in 327.Em cn_nameiop 328and the flags specified in 329.Em cn_flags . 330Valid operations are: 331.Pp 332.Bl -tag -offset indent -width LOOKUP -compact 333.It LOOKUP 334perform name lookup only 335.It CREATE 336set up for file creation 337.It DELETE 338set up for file deletion 339.It RENAME 340set up for file renaming 341.It OPMASK 342mask for operation 343.El 344.Pp 345Valid values for 346.Em cn-\*[Gt]cn_flags 347are: 348.Pp 349.Bl -tag -offset indent -width LOCKPARENT -compact 350.It LOCKLEAF 351lock inode on return 352.It LOCKPARENT 353want parent vnode returned locked 354.It NOCACHE 355name must not be left in name cache (see 356.Xr namecache 9 ) 357.It FOLLOW 358follow symbolic links 359.It NOFOLLOW 360do not follow symbolic links (pseudo) 361.It MODMASK 362mask of operational modifiers 363.El 364.Pp 365No vnode operations may be called from interrupt context. 366Most operations also require the vnode to be locked on entry. 367To prevent deadlocks, when acquiring locks on multiple vnodes, the 368lock of parent directory must be acquired before the lock on the child 369directory. 370.Pp 371Vnode operations for a file system type generally should not be 372called directly from the kernel, but accessed indirectly through the 373high-level convenience functions discussed in 374.Xr vnsubr 9 . 375.Sh FUNCTIONS 376.Bl -tag -width compact 377.It Fn VOP_LOOKUP "dvp" "vpp" "cnp" 378Lookup a single pathname component in a given directory. 379The argument 380.Fa dvp 381is the locked vnode of the directory to search and 382.Fa cnp 383is the pathname component to be searched for. 384If the pathname component is found, the address of the resulting 385locked vnode is returned in 386.Fa vpp . 387The operation specified in 388.Em cnp-\*[Gt]cn_nameiop 389gives 390.Fn VOP_LOOKUP 391hints about the reason for requesting the lookup and uses it to cache 392file system type specific information in the vnode for subsequent 393operations. 394.Pp 395There are three types of lookups: ".", ".." (ISDOTDOT), and other. 396If the pathname component being searched for is ".", then 397.Fa dvp 398has an extra reference added to it and it is returned in 399.Fa *vpp . 400If the pathname component being search for is ".." (ISDOTDOT), 401.Fa dvp 402is unlocked, the ".." node is locked and then 403.Fa dvp 404is relocked. 405This process preserves the protocol of always locking nodes from root 406downward and prevents deadlock. 407For other pathname components, 408.Fn VOP_LOOKUP 409checks the accessibility of the directory and searches the name cache 410for the pathname component. 411See 412.Xr namecache 9 . 413If the pathname is not found in the name cache, the directory is 414searched for the pathname. 415The resulting locked vnode is returned in 416.Fa vpp . 417.Fa dvp 418is always returned locked. 419.Pp 420On failure 421.Fa *vpp 422is 423.Dv NULL , 424and 425.Fa *dvp 426is left locked. 427If the operation is successful 428.Fa *vpp 429is locked and zero is returned. 430Typically, if 431.Fa *vpp 432and 433.Fa dvp 434are the same vnode the caller will need to release twice (decrement 435the reference count) and unlock once. 436.It Fn VOP_CREATE "dvp" "vpp" "cnp" "vap" 437Create a new file in a given directory. 438The argument 439.Fa dvp 440is the locked vnode of the directory to create the new file in and 441.Fa cnp 442is the pathname component of the new file. 443The argument 444.Fa vap 445specifies the attributes that the new file should be created with. 446If the file is successfully created, the address of the resulting 447locked vnode is returned in 448.Fa vpp 449and zero is returned. 450Regardless of the return value, the directory vnode 451.Fa dvp 452will be unlocked on return. 453.Pp 454This function is called after 455.Fn VOP_LOOKUP 456when a file is being created. 457Normally, 458.Fn VOP_LOOKUP 459will have set the SAVENAME flag in 460.Em cnp-\*[Gt]cn_flags 461to keep the memory pointed to by 462.Em cnp-\*[Gt]cn_pnbuf 463valid. 464If an error is detected when creating the file, this memory is 465released. 466If the file is created successfully it will be released unless the 467SAVESTART flags in specified in 468.Em cnp-\*[Gt]cn_flags . 469.It Fn VOP_MKNOD "dvp" "vpp" "cnp" "vap" 470Make a new device-special file in a given directory. 471The argument 472.Fa dvp 473is the locked vnode of the directory to create the new device-special 474file in and 475.Fa cnp 476is the pathname component of the new device-special file. 477The argument 478.Fa vap 479specifies the attributes that the new device-special file should be 480created with. 481If the file is successfully created, the address of the resulting 482locked vnode is returned in 483.Fa vpp 484and zero is returned. 485.Pp 486This function is called after 487.Fn VOP_LOOKUP 488when a device-special file is being created. 489Normally, 490.Fn VOP_LOOKUP 491will have set the SAVENAME flag in 492.Em cnp-\*[Gt]cn_flags 493to keep the memory pointed to by 494.Em cnp-\*[Gt]cn_pnbuf 495valid. 496If an error is detected when creating the device-special file, 497this memory is released. 498If the device-special file is created successfully it will be released 499unless the SAVESTART flags in specified in 500.Em cnp-\*[Gt]cn_flags . 501.It Fn VOP_OPEN "vp" "mode" "cred" 502Open a file. 503The argument 504.Fa vp 505is the vnode of the file to open and 506.Fa mode 507specifies the access mode required by the calling process. 508The calling credentials are specified by 509.Fa cred . 510The access mode is a set of flags, including FREAD, FWRITE, 511O_NONBLOCK, O_APPEND, etc. 512.Fn VOP_OPEN 513must be called before a file can be accessed by a thread. 514The vnode reference count is incremented. 515.Pp 516.Fn VOP_OPEN 517expects the vnode 518.Fa vp 519to be locked on entry and will leave it locked on return. 520If the operation is successful zero is returned, otherwise an 521appropriate error code is returned. 522.It Fn VOP_CLOSE "vp" "fflag" "cred" 523Close a file. 524The argument 525.Fa vp 526is the vnode of the file to close and 527.Fa fflag 528specifies the access mode by the calling process. 529The possible flags are 530.Dv FREAD , 531.Dv FWRITE 532and 533.Dv FNONBLOCK . 534The calling credentials are specified by 535.Fa cred . 536.Fn VOP_CLOSE 537frees resources allocated by 538.Fn VOP_OPEN . 539.Pp 540The vnode 541.Fa vp 542will be locked on entry and should remain locked on return. 543.It Fn VOP_ACCESS "vp" "mode" "cred" 544Determine the accessibility (permissions) of the file against the 545specified credentials. 546The argument 547.Fa vp 548is the vnode of the file to check, 549.Fa mode 550is the type of access required and 551.Fa cred 552contains the user credentials to check. 553The argument 554.Fa mode 555is a mask which can contain VREAD, VWRITE or VEXEC. 556If the file is accessible in the specified way, zero is returned, 557otherwise an appropriate error code is returned. 558.Pp 559The vnode 560.Fa vp 561will be locked on entry and should remain locked on return. 562.It Fn VOP_GETATTR "vp" "vap" "cred" 563Get specific vnode attributes on a file. 564The argument 565.Fa vp 566is the vnode of the file to get the attributes for. 567The argument 568.Fa cred 569specifies the calling credentials. 570.Fn VOP_GETATTR 571uses the file system type specific data object 572.Em vp-\*[Gt]v_data 573to reference the underlying file attributes. 574Attributes associated with the file are collected by setting the 575required attribute bits in 576.Em vap-\*[Gt]va_mask . 577The attributes are returned in 578.Fa vap . 579Attributes which are not available are set to the value VNOVAL. 580.Pp 581For more information on vnode attributes see 582.Xr vattr 9 . 583.It Fn VOP_SETATTR "vp" "vap" "cred" 584Set specific vnode attributes on a file. 585The argument 586.Fa vp 587is the locked vnode of the file to set the attributes for. 588The argument 589.Fa cred 590specifies the calling credentials. 591.Fn VOP_SETATTR 592uses the file system type specific data object 593.Em vp-\*[Gt]v_data 594to reference the underlying file attributes. 595The new attributes are defined in 596.Fa vap . 597Attributes associated with the file are set by setting the required 598attribute bits in 599.Em vap-\*[Gt]va_mask . 600Attributes which are not being modified by 601.Fn VOP_SETATTR 602should be set to the value VNOVAL. 603If the operation is successful zero is returned, otherwise an 604appropriate error is returned. 605.Pp 606For more information on vnode attributes see 607.Xr vattr 9 . 608.It Fn VOP_READ "vp" "uio" "ioflag" "cred" 609Read the contents of a file. 610The argument 611.Fa vp 612is the vnode of the file to read from, 613.Fa uio 614is the location to read the data into, 615.Fa ioflag 616is a set of flags and 617.Fa cred 618are the credentials of the calling process. 619.Pp 620The 621.Fa ioflag 622argument is used to give directives and hints to the file system. 623When attempting a read, the high 16 bits are used to provide a 624read-ahead hint (in unit of file system blocks) that the file system 625should attempt. 626The low 16 bits are a bit mask which can contain the following flags: 627.Pp 628.Bl -tag -offset indent -width IO_ALTSEMANTICS -compact 629.It IO_UNIT 630do I/O as atomic unit 631.It IO_APPEND 632append write to end 633.It IO_SYNC 634sync I/O file integrity completion 635.It IO_NODELOCKED 636underlying node already locked 637.It IO_NDELAY 638FNDELAY flag set in file table 639.It IO_DSYNC 640sync I/O data integrity completion 641.It IO_ALTSEMANTICS 642use alternate I/O semantics 643.It IO_NORMAL 644operate on regular data 645.It IO_EXT 646operate on extended attributes 647.It IO_DIRECT 648do not buffer data in the kernel 649.El 650.Pp 651Zero is returned on success, otherwise an error is returned. 652The vnode should be locked on entry and remains locked on exit. 653.It Fn VOP_WRITE "vp" "uio" "ioflag" "cred" 654Write to a file. 655The argument 656.Fa vp 657is the vnode of the file to write to, 658.Fa uio 659is the location of the data to write, 660.Fa ioflag 661is a set of flags and 662.Fa cred 663are the credentials of the calling process. 664.Pp 665The 666.Fa ioflag 667argument is used to give directives and hints to the file system. 668The low 16 bits are a bit mask which can contain the same flags as 669.Fn VOP_READ . 670.Pp 671Zero is returned on success, otherwise an error is returned. 672The vnode should be locked on entry and remains locked on exit. 673.It Fn VOP_IOCTL "vp" "command" "data" "fflag" "cred" 674Perform device-specific I/O. 675The argument 676.Fa vp 677is the locked vnode of the file, normally representing a device. 678The argument 679.Fa command 680specifies the device-specific operation to perform and 681.Fa cnp 682provides extra data for the specified operation. 683The argument 684.Fa fflags 685is a set of flags. 686The argument 687.Fa cred 688is the caller's credentials. 689If the operation is successful, zero is 690returned, otherwise an appropriate error code is returned. 691.Pp 692Most file systems do not supply a function for 693.Fn VOP_IOCTL . 694This function implements the 695.Xr ioctl 2 696system call. 697.It Fn VOP_FCNTL "vp" "command" "data" "fflag" "cred" 698Perform file control. 699The argument 700.Fa vp 701is the locked vnode of the file. 702The argument 703.Fa command 704specifies the operation to perform and 705.Fa cnp 706provides extra data for the specified operation. 707The argument 708.Fa fflags 709is a set of flags. 710The argument 711.Fa cred 712is the caller's credentials. 713If the operation is successful, zero is returned, otherwise an 714appropriate error code is returned. 715.It Fn VOP_POLL "vp" "events" 716Test if a poll event has occurred. 717The argument 718.Fa vp 719is the vnode of the file to poll. 720It returns any events of interest as specified by 721.Fa events 722that may have occurred for the file. 723The argument 724.Fa events 725is a set of flags as specified by 726.Xr poll 2 . 727.It Fn VOP_KQFILTER "vp" "kn" 728Register a knote 729.Fa kn 730with the vnode 731.Fa vn . 732If the operation is successful zero is returned, otherwise an 733appropriate error code is returned. 734.It Fn VOP_REVOKE "vp" "flags" 735Eliminate all activity associated with the vnode 736.Fa vp . 737The argument 738.Fa flags 739is a set of flags. 740If REVOKEALL is set in 741.Fa flags 742all vnodes aliased to the vnode 743.Fa vp 744are also eliminated. 745If the operation is successful zero is returned, otherwise an 746appropriate error is returned. 747.It Fn VOP_MMAP "vp" "prot" "cred" 748Inform file system that 749.Fa vp 750is in the process of being memory mapped. 751The argument 752.Fa prot 753specifies the vm access protection the vnode is going to be mapped with. 754The argument 755.Fa cred 756is the caller's credentials. 757If the file system allows the memory mapping, zero is returned, otherwise 758an appropriate error code is returned. 759.Pp 760Most file systems do not supply a function for 761.Fn VOP_MMAP 762and use 763.Fn genfs_mmap 764to default for success. 765Only file systems which do not integrate with the page cache at all 766typically want to disallow memory mapping. 767.It Fn VOP_FSYNC "vp" "cred" "flags" "offlo" "offhi" 768Flush pending data buffers for a file to disk. 769The argument 770.Fa vp 771is the locked vnode of the file for flush. 772The argument 773.Fa cred 774is the caller's credentials. 775The argument 776.Fa flags 777is a set of flags. 778If FSYNC_WAIT is specified in 779.Fa flags , 780the function should wait for I/O to complete before returning. 781The argument 782.Fa offlo 783and 784.Fa offhi 785specify the range of file to flush. 786If the operation is successful zero is returned, otherwise an 787appropriate error code is returned. 788.Pp 789This function implements the 790.Xr sync 2 791and 792.Xr fsync 2 793system calls. 794.It Fn VOP_SEEK "vp" "oldoff" "newoff" "cred" 795Test if the file is seekable for the specified offset 796.Fa newoff . 797The argument 798.Fa vp 799is the locked vnode of the file to test. 800For most file systems this function simply tests if 801.Fa newoff 802is valid. 803If the specified 804.Fa newoff 805is less than zero, the function returns error code EINVAL. 806.It Fn VOP_REMOVE "dvp" "vp" "cnp" 807Remove a file. 808The argument 809.Fa dvp 810is the locked vnode of the directory to remove the file from and 811.Fa vp 812is the locked vnode of the file to remove. 813The argument 814.Fa cnp 815is the pathname component about the file to remove. 816If the operation is successful zero is returned, otherwise an 817appropriate error code is returned. 818Both 819.Fa dvp 820and 821.Fa vp 822are locked on entry and are to be unlocked before returning. 823.It Fn VOP_LINK "dvp" "vp" "cnp" 824Link to a file. 825The argument 826.Fa dvp 827is the locked node of the directory to create the new link and 828.Fa vp 829is the vnode of the file to be linked. 830The argument 831.Fa cnp 832is the pathname component of the new link. 833If the operation is successful zero is returned, otherwise an error 834code is returned. 835The directory vnode 836.Fa dvp 837should be locked on entry and will be released and unlocked on return. 838The vnode 839.Fa vp 840should not be locked on entry and will remain unlocked on return. 841.It Fn VOP_RENAME "fdvp" "fvp" "fcnp" "tdvp" "tvp" "tcnp" 842Rename a file. 843The argument 844.Fa fdvp 845is the vnode of the old parent directory containing in the file to be 846renamed and 847.Fa fvp 848is the vnode of the file to be renamed. 849The argument 850.Fa fcnp 851is the pathname component about the file to be renamed. 852The argument 853.Fa tdvp 854is the vnode of the new directory of the target file and 855.Fa tvp 856is the vnode of the target file (if it exists). 857The argument 858.Fa tcnp 859is the pathname component about the file's new name. 860If the operation is successful zero is returned, otherwise and error 861code is returned. 862.Pp 863The source directory and file vnodes should be unlocked and their 864reference counts should be incremented before entry. 865The target directory and file vnodes should both be locked on entry. 866.Fn VOP_RENAME 867updates the reference counts prior to returning. 868.It Fn VOP_MKDIR "dvp" "vpp" "cnp" "vap" 869Make a new directory in a given directory. 870The argument 871.Fa dvp 872is the locked vnode of the directory to create the new directory in and 873.Fa cnp 874is the pathname component of the new directory. 875The argument 876.Fa vap 877specifies the attributes that the new directory should be created 878with. 879If the file is successfully created, the address of the resulting 880locked vnode is returned in 881.Fa vpp 882and zero is returned. 883.Pp 884This function is called after 885.Fn VOP_LOOKUP 886when a directory is being created. 887Normally, 888.Fn VOP_LOOKUP 889will have set the SAVENAME flag in 890.Em cnp-\*[Gt]cn_flags 891to keep the memory pointed to by 892.Em cnp-\*[Gt]cn_pnbuf 893valid. 894If an error is detected when creating the directory, this memory is 895released. 896If the directory is created successfully it will be released unless 897the SAVESTART flags in specified in 898.Em cnp-\*[Gt]cn_flags . 899.It Fn VOP_RMDIR "dvp" "vp" "cnp" 900Remove a directory in a given directory. 901The argument 902.Fa dvp 903is the locked vnode of the directory to remove the directory from and 904.Fa vp 905is the locked vnode of the directory to remove. 906The argument 907.Fa cnp 908is the pathname component of the directory. 909Zero is returned on success, otherwise an error code is returned. 910Both 911.Fa dvp 912and 913.Fa vp 914should be locked on entry and will be released and unlocked on return. 915.It Fn VOP_SYMLINK "dvp" "vpp" "cnp" "vap" "target" 916Create a symbolic link in a given directory. 917The argument 918.Fa dvp 919is the locked vnode of the directory to create the symbolic link in 920and 921.Fa cnp 922is the pathname component of the symbolic link. 923The argument 924.Fa vap 925specifies the attributes that the symbolic link should be created 926with and 927.Fa target 928specifies the pathname of the target of the symbolic link. 929If the symbolic link is successfully created, the address of the 930resulting locked vnode is returned in 931.Fa vpp 932and zero is returned. 933.Pp 934This function is called after 935.Fn VOP_LOOKUP 936when a symbolic link is being created. 937Normally, 938.Fn VOP_LOOKUP 939will have set the SAVENAME flag in 940.Em cnp-\*[Gt]cn_flags 941to keep the memory pointed to by 942.Em cnp-\*[Gt]cn_pnbuf 943valid. 944If an error is detected when creating the symbolic link, this memory 945is released. 946If the symbolic link is created successfully it will be released 947unless the SAVESTART flags in specified in 948.Em cnp-\*[Gt]cn_flags . 949.It Fn VOP_READDIR "vp" "uio" "cred" "eofflag" "cookies" "ncookies" 950Read directory entry. 951The argument 952.Fa vp 953is the vnode of the directory to read the contents of and 954.Fa uio 955is the destination location to read the contents into. 956The argument 957.Fa cred 958is the caller's credentials. 959The argument 960.Fa eofflag 961is the pointer to a flag which is set by 962.Fn VOP_READDIR 963to indicate an end-of-file condition. 964If 965.Fa eofflag 966is 967.Dv NULL , 968the end-of-file condition is not returned. 969The arguments 970.Fa cookies 971and 972.Fa ncookies 973specify the addresses for the list and number of directory seek 974cookies generated for NFS. 975Both 976.Fa cookies 977and 978.Fa ncookies 979should be 980.Dv NULL 981if they aren't required to be returned by 982.Fn VOP_READDIR . 983The directory contents are read into struct dirent structures and 984.Fa uio-\*[Gt]uio_offset 985is set to the offset of the next unread directory entry. 986This offset may be used in a following invocation to continue a 987sequential read of the directory contents. 988If the operation is successful zero is returned, otherwise an 989appropriate error code is returned. 990.Pp 991The directory should be locked on entry and will remain locked on 992return. 993.Pp 994If 995.Fn VOP_READDIR 996is called from the NFS server, the extra arguments 997.Fa eofflag , 998.Fa ncookies 999and 1000.Fa cookies 1001are used. 1002The value of 1003.Fa *eofflag 1004will be set to 1005.Dv true 1006if the end of the directory is reached while 1007reading. 1008The directory seek cookies are returned to the NFS client and may be 1009used later to restart a directory read part way through the directory. 1010There should be one cookie returned per directory entry. 1011The value of the cookie for each directory entry should be the offset 1012within the directory where the on-disk version of the following 1013directory entry starts. 1014That is, for each directory entry 1015.Fa i , 1016the corresponding cookie should refer to the offset of directory entry 1017.Fa i + 1 . 1018.Pp 1019Note that the 1020.Fa cookies 1021array must be allocated by the callee using the M_TEMP malloc type as 1022callers of 1023.Fn VOP_READDIR 1024must be able to free the allocation. 1025.It Fn VOP_READLINK "vp" "uio" "cred" 1026Read the contents of a symbolic link. 1027The argument 1028.Fa vp 1029is the locked vnode of the symlink and 1030.Fa uio 1031is the destination location to read the contents into. 1032The argument 1033.Fa cred 1034is the credentials of the caller. 1035If the operation is successful zero is returned, otherwise an error 1036code is returned. 1037.Pp 1038The vnode should be locked on entry and will remain locked on return. 1039.It Fn VOP_ABORTOP "dvp" "cnp" 1040Abort pending operation on vnode 1041.Fa dvp . 1042This operation is rarely implemented in file systems. 1043.It Fn VOP_INACTIVE "vp" 1044Release the inactive vnode. 1045.Fn VOP_INACTIVE 1046is called when the kernel is no longer using the vnode. 1047This may be because the reference count reaches zero or it may be that 1048the file system is being forcibly unmounted while there are open 1049files. 1050It can be used to reclaim space for open but deleted files. 1051The argument 1052.Fa vp 1053is the locked vnode to be released. 1054If the operation is successful zero is returned, otherwise an 1055appropriate error code is returned. 1056The vnode 1057.Fa vp 1058must be locked on entry, and will be unlocked on return. 1059.It Fn VOP_RECLAIM "vp" 1060Reclaim the vnode for another file system. 1061.Fn VOP_RECLAIM 1062is called when a vnode is being reused for a different file system. 1063Any file system specific resources associated with the vnode should be 1064freed. 1065The argument 1066.Fa vp 1067is the vnode to be reclaimed. 1068If the operation is successful zero is returned, otherwise an 1069appropriate error code is returned. 1070The vnode 1071.Fa vp 1072should not be locked on entry, and will remain unlocked on return. 1073.It Fn VOP_LOCK "vp" "flags" 1074Sleep until vnode lock is free. 1075The argument 1076.Fa vp 1077is the vnode of the file to be locked. 1078The argument 1079.Fa flags 1080is a set of 1081.Xr lockmgr 9 1082flags. 1083If the operation is successful zero is returned, otherwise an 1084appropriate error code is returned. 1085.Fn VOP_LOCK 1086is used to serialize access to the file system such as to prevent two 1087writes to the same file from happening at the same time. 1088Kernel code should use 1089.Xr vn_lock 9 1090to lock a vnode rather than calling 1091.Fn VOP_LOCK 1092directly. 1093.It Fn VOP_UNLOCK "vp" "flags" 1094Wake up process sleeping on lock. 1095The argument 1096.Fa vp 1097is the vnode of the file to be unlocked. 1098The argument 1099.Fa flags 1100is a set of 1101.Xr lockmgr 9 1102flags. 1103If the operation is successful zero is returned, otherwise an 1104appropriate error code is returned. 1105.Fn VOP_UNLOCK 1106is used to serialize access to the file system such as to prevent two 1107writes to the same file from happening at the same time. 1108.It Fn VOP_ISLOCKED "vp" 1109Test if the vnode 1110.Fa vp 1111is locked. 1112A non-zero value is returned if the vnode is not locked, otherwise 1113zero is returned. 1114.It Fn VOP_BMAP "vp" "bn" "vpp" "bnp" "runp" 1115Convert the logical block number 1116.Fa bn 1117of a file specified by vnode 1118.Fa vp 1119to its physical block number on the disk. 1120If 1121.Fa vpp 1122is not 1123.Dv NULL , 1124the vnode of the device vnode for the file system is 1125returned in the address specified by 1126.Fa vpp . 1127If 1128.Fa runp 1129is not 1130.Dv NULL , 1131the number of contiguous blocks starting from the next block after 1132the queried block will be returned in 1133.Fa runp . 1134.It Fn VOP_PRINT "vp" 1135Print debugging information. 1136The argument 1137.Fa vp 1138is the vnode to print. 1139If the operation is successful zero is returned, otherwise an 1140appropriate error code is returned. 1141.It Fn VOP_PATHCONF "vp" "name" "retval" 1142Implement POSIX 1143.Xr pathconf 2 1144and 1145.Xr fpathconf 2 1146support. 1147The argument 1148.Fa vp 1149is the locked vnode to get information about. 1150The argument 1151.Fa name 1152specified the type of information to return. 1153The information is returned in the address specified by 1154.Fa retval . 1155Valid values for 1156.Fa name 1157are: 1158.Pp 1159.Bl -tag -offset indent -width _PC_CHOWN_RESTRICTED -compact 1160.It _PC_LINK_MAX 1161return the maximum number of links to a file 1162.It _PC_NAME_MAX 1163return the maximum number of bytes in a file name 1164.It _PC_PATH_MAX 1165return the maximum number of bytes in a pathname 1166.It _PC_PIPE_BUF 1167return the maximum number of bytes which will be written atomically to 1168a pipe 1169.It _PC_CHOWN_RESTRICTED 1170return 1 if appropriate privileges are required for the 1171.Xr chown 2 1172system call, otherwise zero 1173.It _PC_NO_TRUNC 1174return if file names longer than KERN_NAME_MAX are truncated 1175.El 1176.Pp 1177If 1178.Fa name 1179is recognized, 1180.Fa *retval 1181is set to the specified value and zero is returned, otherwise an 1182appropriate error is returned. 1183.It Fn VOP_ADVLOCK "vp" "id" "op" "fl" "flags" 1184Manipulate Advisory record locks on a vnode. 1185The argument 1186.Fa vp 1187is the vnode on which locks are manipulated. 1188The argument 1189.Fa id 1190is the id token which is changing the lock and 1191.Fa op 1192is the 1193.Xr fcntl 2 1194operation to perform. 1195Valid values are: 1196.Pp 1197.Bl -tag -offset indent -width F_UNLCK -compact 1198.It F_SETLK 1199set lock 1200.It F_GETLK 1201get the first conflicted lock 1202.It F_UNLCK 1203clear lock 1204.El 1205.Pp 1206The argument 1207.Fa fl 1208is a description of the lock. 1209In the case of 1210.Dv SEEK_CUR , 1211The caller should add the current file offset to 1212fl-\*[Gt]l_start beforehand. 1213.Fn VOP_ADVLOCK 1214treats 1215.Dv SEEK_CUR 1216as 1217.Dv SEEK_SET . 1218.Pp 1219The argument 1220.Fa flags 1221is the set of flags. 1222Valid values are: 1223.Pp 1224.Bl -tag -offset indent -width F_FLOCK -compact 1225.It F_WAIT 1226wait until lock is granted 1227.It F_FLOCK 1228use 1229.Xr flock 2 1230semantics for lock 1231.It F_POSIX 1232use POSIX semantics for lock 1233.El 1234.Pp 1235If the operation is successful zero is returned, otherwise an 1236appropriate error is returned. 1237.It Fn VOP_LEASE "vp" "cred" "flags" 1238Validate vnode credentials and operation type. 1239The argument 1240.Fa vp 1241is the locked vnode of the file to validate credentials 1242.Fa cred . 1243The argument 1244.Fa flags 1245specifies the operation flags. 1246If the operation is successful zero is returned, otherwise an 1247appropriate error code is returned. 1248The vnode must be locked on entry and remains locked on return. 1249.It Fn VOP_WHITEOUT "dvp" "cnp" "flags" 1250Whiteout pathname component in directory with vnode 1251.Fa dvp . 1252The argument 1253.Fa cnp 1254specifies the pathname component to whiteout. 1255.It Fn VOP_GETPAGES "vp" "offset" "m" "count" "centeridx" "access_type" "advice" "flags" 1256Read VM pages from file. 1257The argument 1258.Fa vp 1259is the locked vnode to read the VM pages from. 1260The argument 1261.Fa offset 1262is offset in the file to start accessing and 1263.Fa m 1264is an array of VM pages. 1265The argument 1266.Fa count 1267points a variable that specifies the number of pages to read. 1268If the operation is successful zero is returned, otherwise an 1269appropriate error code is returned. 1270If PGO_LOCKED is specified in 1271.Em flags , 1272.Fn VOP_GETPAGES 1273might return less pages than requested. 1274In that case, the variable pointed to by 1275.Em count 1276will be updated. 1277.Pp 1278This function is primarily used by the page-fault handing mechanism. 1279.It Fn VOP_PUTPAGES "vp" "offlo" "offhi" "flags" 1280Write modified (dirty) VM pages to file. 1281The argument 1282.Fa vp 1283is the vnode to write the VM pages to. 1284The vnode's vm object lock 1285.Va ( v_uobj.vmobjlock ) 1286must be held by the caller and will be released upon return. 1287The arguments 1288.Fa offlo 1289and 1290.Fa offhi 1291specify the range of VM pages to write. 1292In case 1293.Fa offhi 1294is given as 0, all pages at and after the start offset 1295.Fa offlo 1296belonging the vnode 1297.Fa vp 1298will be written. 1299The argument 1300.Fa flags 1301controls the behavior of the routine and takes the vm pager's 1302flags 1303.Dv ( PGO_ -prefixed ) . 1304If the operation is successful zero is returned, otherwise an 1305appropriate error code is returned. 1306.Pp 1307The function is primarily used by the pageout handling mechanism and 1308is commonly implemented indirectly 1309by 1310.Fn genfs_putpages 1311with the help of 1312.Fn VOP_STRATEGY 1313and 1314.Fn VOP_BMAP . 1315.It Fn VOP_STRATEGY "vp" "bp" 1316Read/write a file system buffer. 1317The argument 1318.Fa vp 1319is the vnode to read/write to. 1320The argument 1321.Fa bp 1322is the buffer to be read or written. 1323.Fn VOP_STRATEGY 1324will either read or write data to the file depending on the value of 1325.Em bp-\*[Gt]b_flags . 1326If the operation is successful zero is returned, otherwise an 1327appropriate error code is returned. 1328.It Fn VOP_BWRITE "bp" 1329Write a file system buffer. 1330The argument 1331.Fa bp 1332specifies the buffer to be written. 1333If the operation is successful zero is returned, otherwise an 1334appropriate error code is returned. 1335.It Fn VOP_GETEXTATTR "vp" "attrnamespace" "name" "uio" "size" "cred" 1336Get an extended attribute. 1337The argument 1338.Fa vp 1339is the locked vnode of the file or directory from which to retrieve the 1340attribute. 1341The argument 1342.Fa attrnamespace 1343specifies the extended attribute namespace. 1344The argument 1345.Fa name 1346is a nul-terminated character string naming the attribute to retrieve. 1347The argument 1348.Fa uio , 1349if not 1350.Dv NULL , 1351specifies where the extended attribute value is to be written. 1352The argument 1353.Fa size , 1354if not 1355.Dv NULL , 1356will contain the number of bytes required to read all of 1357the attribute data upon return. 1358In most cases, 1359.Fa uio 1360will be 1361.Dv NULL 1362when 1363.Fa size 1364is not, and vice versa. 1365The argument 1366.Fa cred 1367specifies the user credentials to use when authorizing the request. 1368.It Fn VOP_SETEXTATTR "vp" "attrnamespace" "name" "uio" "cred" 1369Set an extended attribute. 1370The argument 1371.Fa vp 1372is the locked vnode of the file or directory to which to store the 1373attribute. 1374The argument 1375.Fa namespace 1376specifies the extended attribute namespace. 1377The argument 1378.Fa name 1379is a nul-terminated character string naming the attribute to store. 1380The argument 1381.Fa uio 1382specifies the source of the extended attribute data. 1383The argument 1384.Fa cred 1385specifies the user credentials to use when authorizing the request. 1386.It Fn VOP_LISTEXTATTR "vp" "attrnamespace" "uio" "size" "cred" 1387Retrieve the list of extended attributes. 1388The argument 1389.Fa vp 1390is the locked vnode of the file or directory whose attributes are to be listed. 1391The argument 1392.Fa attrnamespace 1393specifies the extended attribute namespace. 1394The argument 1395.Fa uio , 1396if not 1397.Dv NULL , 1398specifies where the extended attribute list is to be written. 1399The argument 1400.Fa size , 1401if not 1402.Dv NULL , 1403will contain the number of bytes required to read all of 1404the attribute names upon return. 1405In most cases, 1406.Fa uio 1407will be 1408.Dv NULL 1409when 1410.Fa size 1411is not, and vice versa. 1412The argument 1413.Fa cred 1414specifies the user credentials to use when authorizing the request. 1415.El 1416.Sh ERRORS 1417.Bl -tag -width Er 1418.It Bq Er ENOATTR 1419The requested attribute is not defined for this vnode. 1420.It Bq Er ENOTDIR 1421The vnode does not represent a directory. 1422.It Bq Er ENOENT 1423The component was not found in the directory. 1424.It Bq Er ENOSPC 1425The file system is full. 1426.It Bq Er EDQUOT 1427Quota exceeded. 1428.It Bq Er EACCES 1429Access for the specified operation is denied. 1430.It Bq Er EJUSTRETURN 1431A CREATE or RENAME operation would be successful. 1432.It Bq Er EPERM 1433an attempt was made to change an immutable file 1434.It Bq Er ENOTEMPTY 1435attempt to remove a directory which is not empty 1436.It Bq Er EINVAL 1437attempt to read from an illegal offset in the directory; unrecognized 1438input 1439.It Bq Er EIO 1440a read error occurred while reading the directory or reading the 1441contents of a symbolic link 1442.It Bq Er EROFS 1443the file system is read-only 1444.El 1445.Sh SEE ALSO 1446.Xr extattr 9 , 1447.Xr intro 9 , 1448.Xr lock 9 , 1449.Xr namei 9 , 1450.Xr vattr 9 , 1451.Xr vfs 9 , 1452.Xr vfsops 9 , 1453.Xr vnode 9 1454.Sh HISTORY 1455The vnode operations vector, its functions and the corresponding 1456macros appeared in 1457.Bx 4.3 . 1458