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