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