LCOV - code coverage report
Current view: top level - sys - vnode.h (source / functions) Hit Total Coverage
Test: 6.4 Lines: 0 1 0.0 %
Date: 2018-10-19 03:25:38 Functions: 0 4 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*      $OpenBSD: vnode.h,v 1.148 2018/08/13 15:26:17 visa Exp $        */
       2             : /*      $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $   */
       3             : 
       4             : /*
       5             :  * Copyright (c) 1989, 1993
       6             :  *      The Regents of the University of California.  All rights reserved.
       7             :  *
       8             :  * Redistribution and use in source and binary forms, with or without
       9             :  * modification, are permitted provided that the following conditions
      10             :  * are met:
      11             :  * 1. Redistributions of source code must retain the above copyright
      12             :  *    notice, this list of conditions and the following disclaimer.
      13             :  * 2. Redistributions in binary form must reproduce the above copyright
      14             :  *    notice, this list of conditions and the following disclaimer in the
      15             :  *    documentation and/or other materials provided with the distribution.
      16             :  * 3. Neither the name of the University nor the names of its contributors
      17             :  *    may be used to endorse or promote products derived from this software
      18             :  *    without specific prior written permission.
      19             :  *
      20             :  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
      21             :  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      22             :  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      23             :  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
      24             :  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
      25             :  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
      26             :  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
      27             :  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
      28             :  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
      29             :  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
      30             :  * SUCH DAMAGE.
      31             :  *
      32             :  *      @(#)vnode.h     8.11 (Berkeley) 11/21/94
      33             :  */
      34             : 
      35             : #ifndef _SYS_VNODE_H_
      36             : #define _SYS_VNODE_H_
      37             : 
      38             : #include <sys/buf.h>
      39             : #include <sys/types.h>
      40             : #include <sys/queue.h>
      41             : #include <sys/selinfo.h>
      42             : #include <sys/tree.h>
      43             : 
      44             : /*
      45             :  * The vnode is the focus of all file activity in UNIX.  There is a
      46             :  * unique vnode allocated for each active file, each current directory,
      47             :  * each mounted-on file, text file, and the root.
      48             :  */
      49             : 
      50             : /*
      51             :  * Vnode types.  VNON means no type.
      52             :  */
      53             : enum vtype      { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD };
      54             : 
      55             : #define VTYPE_NAMES \
      56             :     "VNON", "VREG", "VDIR", "VBLK", "VCHR", "VLNK", "VSOCK", "VFIFO", "VBAD"
      57             : 
      58             : /*
      59             :  * Vnode tag types.
      60             :  * These are for the benefit of external programs only (e.g., pstat)
      61             :  * and should NEVER be inspected by the kernel.
      62             :  *
      63             :  * Note that v_tag is actually used to tell MFS from FFS, and EXT2FS from
      64             :  * the rest, so don't believe the above comment!
      65             :  */
      66             : enum vtagtype   {
      67             :         VT_NON, VT_UFS, VT_NFS, VT_MFS, VT_MSDOSFS,
      68             :         VT_PORTAL, VT_PROCFS, VT_AFS, VT_ISOFS, VT_ADOSFS,
      69             :         VT_EXT2FS, VT_VFS, VT_NTFS, VT_UDF, VT_FUSEFS, VT_TMPFS,
      70             : };
      71             : 
      72             : #define VTAG_NAMES \
      73             :     "NON", "UFS", "NFS", "MFS", "MSDOSFS",                    \
      74             :     "unused", "unused", "unused", "ISOFS", "unused",          \
      75             :     "EXT2FS", "VFS", "NTFS", "UDF", "FUSEFS", "TMPFS"
      76             : 
      77             : /*
      78             :  * Each underlying filesystem allocates its own private area and hangs
      79             :  * it from v_data.  If non-null, this area is freed in getnewvnode().
      80             :  */
      81             : LIST_HEAD(buflists, buf);
      82             : 
      83             : RBT_HEAD(buf_rb_bufs, buf);
      84             : 
      85             : struct namecache;
      86             : RBT_HEAD(namecache_rb_cache, namecache);
      87             : 
      88             : struct uvm_vnode;
      89             : struct vnode {
      90             :         struct uvm_vnode *v_uvm;                /* uvm data */
      91             :         struct vops *v_op;                      /* vnode operations vector */
      92             :         enum    vtype v_type;                   /* vnode type */
      93             :         enum    vtagtype v_tag;                 /* type of underlying data */
      94             :         u_int   v_flag;                         /* vnode flags (see below) */
      95             :         u_int   v_usecount;                     /* reference count of users */
      96             :         u_int   v_uvcount;                      /* unveil references */
      97             :         /* reference count of writers */
      98             :         u_int   v_writecount;
      99             :         /* Flags that can be read/written in interrupts */
     100             :         u_int   v_bioflag;
     101             :         u_int   v_holdcnt;                      /* buffer references */
     102             :         u_int   v_id;                           /* capability identifier */
     103             :         u_int   v_inflight;
     104             :         struct  mount *v_mount;                 /* ptr to vfs we are in */
     105             :         TAILQ_ENTRY(vnode) v_freelist;          /* vnode freelist */
     106             :         LIST_ENTRY(vnode) v_mntvnodes;          /* vnodes for mount point */
     107             :         struct  buf_rb_bufs v_bufs_tree;        /* lookup of all bufs */
     108             :         struct  buflists v_cleanblkhd;          /* clean blocklist head */
     109             :         struct  buflists v_dirtyblkhd;          /* dirty blocklist head */
     110             :         u_int   v_numoutput;                    /* num of writes in progress */
     111             :         LIST_ENTRY(vnode) v_synclist;           /* vnode with dirty buffers */
     112             :         union {
     113             :                 struct mount    *vu_mountedhere;/* ptr to mounted vfs (VDIR) */
     114             :                 struct socket   *vu_socket;     /* unix ipc (VSOCK) */
     115             :                 struct specinfo *vu_specinfo;   /* device (VCHR, VBLK) */
     116             :                 struct fifoinfo *vu_fifoinfo;   /* fifo (VFIFO) */
     117             :         } v_un;
     118             : 
     119             :         /* VFS namecache */
     120             :         struct namecache_rb_cache v_nc_tree;
     121             :         TAILQ_HEAD(, namecache) v_cache_dst;     /* cache entries to us */
     122             : 
     123             :         void    *v_data;                        /* private data for fs */
     124             :         struct  selinfo v_selectinfo;           /* identity of poller(s) */
     125             : };
     126             : #define v_mountedhere   v_un.vu_mountedhere
     127             : #define v_socket        v_un.vu_socket
     128             : #define v_specinfo      v_un.vu_specinfo
     129             : #define v_fifoinfo      v_un.vu_fifoinfo
     130             : 
     131             : /*
     132             :  * Vnode flags.
     133             :  */
     134             : #define VROOT           0x0001  /* root of its file system */
     135             : #define VTEXT           0x0002  /* vnode is a pure text prototype */
     136             : #define VSYSTEM         0x0004  /* vnode being used by kernel */
     137             : #define VISTTY          0x0008  /* vnode represents a tty */
     138             : #define VXLOCK          0x0100  /* vnode is locked to change underlying type */
     139             : #define VXWANT          0x0200  /* process is waiting for vnode */
     140             : #define VCLONED         0x0400  /* vnode was cloned */
     141             : #define VALIASED        0x0800  /* vnode has an alias */
     142             : #define VLARVAL         0x1000  /* vnode data not yet set up by higher level */
     143             : #define VLOCKSWORK      0x4000  /* FS supports locking discipline */
     144             : #define VCLONE          0x8000  /* vnode is a clone */
     145             : 
     146             : /*
     147             :  * (v_bioflag) Flags that may be manipulated by interrupt handlers
     148             :  */
     149             : #define VBIOWAIT        0x0001  /* waiting for output to complete */
     150             : #define VBIOONSYNCLIST  0x0002  /* Vnode is on syncer worklist */
     151             : #define VBIOONFREELIST  0x0004  /* Vnode is on a free list */
     152             : 
     153             : /*
     154             :  * Vnode attributes.  A field value of VNOVAL represents a field whose value
     155             :  * is unavailable (getattr) or which is not to be changed (setattr).  For
     156             :  * the timespec fields, only the tv_nsec member needs to be set to VNOVAL:
     157             :  * if tv_nsec != VNOVAL then both tv_sec and tv_nsec are valid.
     158             :  */
     159             : struct vattr {
     160             :         enum vtype      va_type;        /* vnode type (for create) */
     161             :         mode_t          va_mode;        /* files access mode and type */
     162             :         nlink_t         va_nlink;       /* number of references to file */
     163             :         uid_t           va_uid;         /* owner user id */
     164             :         gid_t           va_gid;         /* owner group id */
     165             :         long            va_fsid;        /* file system id (dev for now) */
     166             :         u_quad_t        va_fileid;      /* file id */
     167             :         u_quad_t        va_size;        /* file size in bytes */
     168             :         long            va_blocksize;   /* blocksize preferred for i/o */
     169             :         struct timespec va_atime;       /* time of last access */
     170             :         struct timespec va_mtime;       /* time of last modification */
     171             :         struct timespec va_ctime;       /* time file changed */
     172             :         u_long          va_gen;         /* generation number of file */
     173             :         u_long          va_flags;       /* flags defined for file */
     174             :         dev_t           va_rdev;        /* device the special file represents */
     175             :         u_quad_t        va_bytes;       /* bytes of disk space held by file */
     176             :         u_quad_t        va_filerev;     /* file modification number */
     177             :         u_int           va_vaflags;     /* operations flags, see below */
     178             :         long            va_spare;       /* remain quad aligned */
     179             : };
     180             : 
     181             : /*
     182             :  * Flags for va_vaflags.
     183             :  */
     184             : #define VA_UTIMES_NULL          0x01    /* utimes argument was NULL */
     185             : #define VA_EXCLUSIVE            0x02    /* exclusive create request */
     186             : #define VA_UTIMES_CHANGE        0x04    /* ctime should be updated */
     187             : /*
     188             :  * Flags for ioflag.
     189             :  */
     190             : #define IO_UNIT         0x01            /* do I/O as atomic unit */
     191             : #define IO_APPEND       0x02            /* append write to end */
     192             : #define IO_SYNC         0x04            /* do I/O synchronously */
     193             : #define IO_NODELOCKED   0x08            /* underlying node already locked */
     194             : #define IO_NDELAY       0x10            /* FNDELAY flag set in file table */
     195             : #define IO_NOLIMIT      0x20            /* don't enforce limits on i/o */
     196             : #define IO_NOCACHE      0x40            /* don't cache result of this i/o */
     197             : 
     198             : /*
     199             :  *  Modes.  Some values same as Ixxx entries from inode.h for now.
     200             :  */
     201             : #define VSUID   04000           /* set user id on execution */
     202             : #define VSGID   02000           /* set group id on execution */
     203             : #define VSVTX   01000           /* save swapped text even after use */
     204             : #define VREAD   00400           /* read, write, execute permissions */
     205             : #define VWRITE  00200
     206             : #define VEXEC   00100
     207             : 
     208             : /*
     209             :  * Token indicating no attribute value yet assigned.
     210             :  */
     211             : #define VNOVAL  (-1)
     212             : 
     213             : #ifdef _KERNEL
     214           0 : RBT_PROTOTYPE(buf_rb_bufs, buf, b_rbbufs, rb_buf_compare);
     215             : /*
     216             :  * Convert between vnode types and inode formats (since POSIX.1
     217             :  * defines mode word of stat structure in terms of inode formats).
     218             :  */
     219             : extern enum vtype       iftovt_tab[];
     220             : extern int              vttoif_tab[];
     221             : #define IFTOVT(mode)    (iftovt_tab[((mode) & S_IFMT) >> 12])
     222             : #define VTTOIF(indx)    (vttoif_tab[(int)(indx)])
     223             : #define MAKEIMODE(indx, mode)   (int)(VTTOIF(indx) | (mode))
     224             : 
     225             : /*
     226             :  * Flags to various vnode functions.
     227             :  */
     228             : #define SKIPSYSTEM      0x0001          /* vflush: skip vnodes marked VSYSTEM */
     229             : #define FORCECLOSE      0x0002          /* vflush: force file closeure */
     230             : #define WRITECLOSE      0x0004          /* vflush: only close writeable files */
     231             : #define DOCLOSE         0x0008          /* vclean: close active files */
     232             : #define IGNORECLEAN     0x0010          /* vflush: ignore clean vnodes */
     233             : #define V_SAVE          0x0001          /* vinvalbuf: sync file first */
     234             : #define V_SAVEMETA      0x0002          /* vinvalbuf: leave indirect blocks */
     235             : 
     236             : #define REVOKEALL       0x0001          /* vop_revoke: revoke all aliases */
     237             : 
     238             : 
     239             : TAILQ_HEAD(freelst, vnode);
     240             : extern struct freelst vnode_hold_list;  /* free vnodes referencing buffers */
     241             : extern struct freelst vnode_free_list;  /* vnode free list */
     242             : 
     243             : #define VATTR_NULL(vap) vattr_null(vap)
     244             : #define NULLVP  ((struct vnode *)NULL)
     245             : #define VN_KNOTE(vp, b)                                 \
     246             :         KNOTE(&vp->v_selectinfo.si_note, (b))
     247             : 
     248             : /*
     249             :  * Global vnode data.
     250             :  */
     251             : extern  struct vnode *rootvnode;        /* root (i.e. "/") vnode */
     252             : extern  int initialvnodes;              /* XXX number of vnodes to start */
     253             : extern  int maxvnodes;                  /* XXX number of vnodes to allocate */
     254             : extern  int syncdelay;                  /* seconds to delay syncing vnodes */
     255             : extern  int rushjob;                    /* # of slots syncer should run ASAP */
     256             : extern void    vhold(struct vnode *);
     257             : extern void    vdrop(struct vnode *);
     258             : 
     259             : /* vnode operations */
     260             : struct vops {
     261             :         int     (*vop_lock)(void *);
     262             :         int     (*vop_unlock)(void *);
     263             :         int     (*vop_islocked)(void *);
     264             :         int     (*vop_abortop)(void *);
     265             :         int     (*vop_access)(void *);
     266             :         int     (*vop_advlock)(void *);
     267             :         int     (*vop_bmap)(void *);
     268             :         int     (*vop_bwrite)(void *);
     269             :         int     (*vop_close)(void *);
     270             :         int     (*vop_create)(void *);
     271             :         int     (*vop_fsync)(void *);
     272             :         int     (*vop_getattr)(void *);
     273             :         int     (*vop_inactive)(void *);
     274             :         int     (*vop_ioctl)(void *);
     275             :         int     (*vop_link)(void *);
     276             :         int     (*vop_lookup)(void *);
     277             :         int     (*vop_mknod)(void *);
     278             :         int     (*vop_open)(void *);
     279             :         int     (*vop_pathconf)(void *);
     280             :         int     (*vop_poll)(void *);
     281             :         int     (*vop_print)(void *);
     282             :         int     (*vop_read)(void *);
     283             :         int     (*vop_readdir)(void *);
     284             :         int     (*vop_readlink)(void *);
     285             :         int     (*vop_reclaim)(void *);
     286             :         int     (*vop_remove)(void *);
     287             :         int     (*vop_rename)(void *);
     288             :         int     (*vop_revoke)(void *);
     289             :         int     (*vop_mkdir)(void *);
     290             :         int     (*vop_rmdir)(void *);
     291             :         int     (*vop_setattr)(void *);
     292             :         int     (*vop_strategy)(void *);
     293             :         int     (*vop_symlink)(void *);
     294             :         int     (*vop_write)(void *);
     295             :         int     (*vop_kqfilter)(void *);
     296             : };
     297             : 
     298             : extern struct vops dead_vops;
     299             : extern struct vops spec_vops;
     300             : 
     301             : struct vop_generic_args {
     302             :         void            *a_garbage;
     303             :         /* Other data probably follows; */
     304             : };
     305             : 
     306             : struct vop_islocked_args {
     307             :         struct vnode *a_vp;
     308             : };
     309             : int VOP_ISLOCKED(struct vnode *);
     310             : 
     311             : struct vop_lookup_args {
     312             :         struct vnode *a_dvp;
     313             :         struct vnode **a_vpp;
     314             :         struct componentname *a_cnp;
     315             : };
     316             : int VOP_LOOKUP(struct vnode *, struct vnode **, struct componentname *);
     317             : 
     318             : struct vop_create_args {
     319             :         struct vnode *a_dvp;
     320             :         struct vnode **a_vpp;
     321             :         struct componentname *a_cnp;
     322             :         struct vattr *a_vap;
     323             : };
     324             : int VOP_CREATE(struct vnode *, struct vnode **, struct componentname *,
     325             :     struct vattr *);
     326             : 
     327             : struct vop_mknod_args {
     328             :         struct vnode *a_dvp;
     329             :         struct vnode **a_vpp;
     330             :         struct componentname *a_cnp;
     331             :         struct vattr *a_vap;
     332             : };
     333             : int VOP_MKNOD(struct vnode *, struct vnode **, struct componentname *,
     334             :     struct vattr *);
     335             : 
     336             : struct vop_open_args {
     337             :         struct vnode *a_vp;
     338             :         int a_mode;
     339             :         struct ucred *a_cred;
     340             :         struct proc *a_p;
     341             : };
     342             : int VOP_OPEN(struct vnode *, int, struct ucred *, struct proc *);
     343             : 
     344             : struct vop_close_args {
     345             :         struct vnode *a_vp;
     346             :         int a_fflag;
     347             :         struct ucred *a_cred;
     348             :         struct proc *a_p;
     349             : };
     350             : int VOP_CLOSE(struct vnode *, int, struct ucred *, struct proc *);
     351             : 
     352             : struct vop_access_args {
     353             :         struct vnode *a_vp;
     354             :         int a_mode;
     355             :         struct ucred *a_cred;
     356             :         struct proc *a_p;
     357             : };
     358             : int VOP_ACCESS(struct vnode *, int, struct ucred *, struct proc *);
     359             : 
     360             : struct vop_getattr_args {
     361             :         struct vnode *a_vp;
     362             :         struct vattr *a_vap;
     363             :         struct ucred *a_cred;
     364             :         struct proc *a_p;
     365             : };
     366             : int VOP_GETATTR(struct vnode *, struct vattr *, struct ucred *, struct proc *);
     367             : 
     368             : struct vop_setattr_args {
     369             :         struct vnode *a_vp;
     370             :         struct vattr *a_vap;
     371             :         struct ucred *a_cred;
     372             :         struct proc *a_p;
     373             : };
     374             : int VOP_SETATTR(struct vnode *, struct vattr *, struct ucred *, struct proc *);
     375             : 
     376             : struct vop_read_args {
     377             :         struct vnode *a_vp;
     378             :         struct uio *a_uio;
     379             :         int a_ioflag;
     380             :         struct ucred *a_cred;
     381             : };
     382             : int VOP_READ(struct vnode *, struct uio *, int, struct ucred *);
     383             : 
     384             : struct vop_write_args {
     385             :         struct vnode *a_vp;
     386             :         struct uio *a_uio;
     387             :         int a_ioflag;
     388             :         struct ucred *a_cred;
     389             : };
     390             : int VOP_WRITE(struct vnode *, struct uio *, int, struct ucred *);
     391             : 
     392             : struct vop_ioctl_args {
     393             :         struct vnode *a_vp;
     394             :         u_long a_command;
     395             :         void *a_data;
     396             :         int a_fflag;
     397             :         struct ucred *a_cred;
     398             :         struct proc *a_p;
     399             : };
     400             : int VOP_IOCTL(struct vnode *, u_long, void *, int, struct ucred *,
     401             :     struct proc *);
     402             : 
     403             : struct vop_poll_args {
     404             :         struct vnode *a_vp;
     405             :         int a_fflag;
     406             :         int a_events;
     407             :         struct proc *a_p;
     408             : };
     409             : int VOP_POLL(struct vnode *, int, int, struct proc *);
     410             : 
     411             : struct vop_kqfilter_args {
     412             :         struct vnode *a_vp;
     413             :         struct knote *a_kn;
     414             : };
     415             : int VOP_KQFILTER(struct vnode *, struct knote *);
     416             : 
     417             : struct vop_revoke_args {
     418             :         struct vnode *a_vp;
     419             :         int a_flags;
     420             : };
     421             : int VOP_REVOKE(struct vnode *, int);
     422             : 
     423             : struct vop_fsync_args {
     424             :         struct vnode *a_vp;
     425             :         struct ucred *a_cred;
     426             :         int a_waitfor;
     427             :         struct proc *a_p;
     428             : };
     429             : int VOP_FSYNC(struct vnode *, struct ucred *, int, struct proc *);
     430             : 
     431             : struct vop_remove_args {
     432             :         struct vnode *a_dvp;
     433             :         struct vnode *a_vp;
     434             :         struct componentname *a_cnp;
     435             : };
     436             : int VOP_REMOVE(struct vnode *, struct vnode *, struct componentname *);
     437             : 
     438             : struct vop_link_args {
     439             :         struct vnode *a_dvp;
     440             :         struct vnode *a_vp;
     441             :         struct componentname *a_cnp;
     442             : };
     443             : int VOP_LINK(struct vnode *, struct vnode *, struct componentname *);
     444             : 
     445             : struct vop_rename_args {
     446             :         struct vnode *a_fdvp;
     447             :         struct vnode *a_fvp;
     448             :         struct componentname *a_fcnp;
     449             :         struct vnode *a_tdvp;
     450             :         struct vnode *a_tvp;
     451             :         struct componentname *a_tcnp;
     452             : };
     453             : int VOP_RENAME(struct vnode *, struct vnode *, struct componentname *,
     454             :     struct vnode *, struct vnode *, struct componentname *);
     455             : 
     456             : struct vop_mkdir_args {
     457             :         struct vnode *a_dvp;
     458             :         struct vnode **a_vpp;
     459             :         struct componentname *a_cnp;
     460             :         struct vattr *a_vap;
     461             : };
     462             : int VOP_MKDIR(struct vnode *, struct vnode **, struct componentname *,
     463             :     struct vattr *);
     464             : 
     465             : struct vop_rmdir_args {
     466             :         struct vnode *a_dvp;
     467             :         struct vnode *a_vp;
     468             :         struct componentname *a_cnp;
     469             : };
     470             : int VOP_RMDIR(struct vnode *, struct vnode *, struct componentname *);
     471             : 
     472             : struct vop_symlink_args {
     473             :         struct vnode *a_dvp;
     474             :         struct vnode **a_vpp;
     475             :         struct componentname *a_cnp;
     476             :         struct vattr *a_vap;
     477             :         char *a_target;
     478             : };
     479             : int VOP_SYMLINK(struct vnode *, struct vnode **, struct componentname *,
     480             :     struct vattr *, char *);
     481             : 
     482             : struct vop_readdir_args {
     483             :         struct vnode *a_vp;
     484             :         struct uio *a_uio;
     485             :         struct ucred *a_cred;
     486             :         int *a_eofflag;
     487             : };
     488             : int VOP_READDIR(struct vnode *, struct uio *, struct ucred *, int *);
     489             : 
     490             : struct vop_readlink_args {
     491             :         struct vnode *a_vp;
     492             :         struct uio *a_uio;
     493             :         struct ucred *a_cred;
     494             : };
     495             : int VOP_READLINK(struct vnode *, struct uio *, struct ucred *);
     496             : 
     497             : struct vop_abortop_args {
     498             :         struct vnode *a_dvp;
     499             :         struct componentname *a_cnp;
     500             : };
     501             : int VOP_ABORTOP(struct vnode *, struct componentname *);
     502             : 
     503             : struct vop_inactive_args {
     504             :         struct vnode *a_vp;
     505             :         struct proc *a_p;
     506             : };
     507             : int VOP_INACTIVE(struct vnode *, struct proc *);
     508             : 
     509             : struct vop_reclaim_args {
     510             :         struct vnode *a_vp;
     511             :         struct proc *a_p;
     512             : };
     513             : int VOP_RECLAIM(struct vnode *, struct proc *);
     514             : 
     515             : struct vop_lock_args {
     516             :         struct vnode *a_vp;
     517             :         int a_flags;
     518             : };
     519             : int VOP_LOCK(struct vnode *, int);
     520             : 
     521             : struct vop_unlock_args {
     522             :         struct vnode *a_vp;
     523             : };
     524             : int VOP_UNLOCK(struct vnode *);
     525             : 
     526             : struct vop_bmap_args {
     527             :         struct vnode *a_vp;
     528             :         daddr_t a_bn;
     529             :         struct vnode **a_vpp;
     530             :         daddr_t *a_bnp;
     531             :         int *a_runp;
     532             : };
     533             : int VOP_BMAP(struct vnode *, daddr_t, struct vnode **, daddr_t *, int *);
     534             : 
     535             : struct vop_print_args {
     536             :         struct vnode *a_vp;
     537             : };
     538             : int VOP_PRINT(struct vnode *);
     539             : 
     540             : struct vop_pathconf_args {
     541             :         struct vnode *a_vp;
     542             :         int a_name;
     543             :         register_t *a_retval;
     544             : };
     545             : int VOP_PATHCONF(struct vnode *, int, register_t *);
     546             : 
     547             : struct vop_advlock_args {
     548             :         struct vnode *a_vp;
     549             :         void *a_id;
     550             :         int a_op;
     551             :         struct flock *a_fl;
     552             :         int a_flags;
     553             : };
     554             : int VOP_ADVLOCK(struct vnode *, void *, int, struct flock *, int);
     555             : 
     556             : /* Special cases: */
     557             : struct vop_strategy_args {
     558             :         struct buf *a_bp;
     559             : };
     560             : int VOP_STRATEGY(struct buf *);
     561             : 
     562             : struct vop_bwrite_args {
     563             :         struct buf *a_bp;
     564             : };
     565             : int VOP_BWRITE(struct buf *);
     566             : /* End of special cases. */
     567             : 
     568             : 
     569             : /* Public vnode manipulation functions. */
     570             : struct file;
     571             : struct filedesc;
     572             : struct mount;
     573             : struct nameidata;
     574             : struct proc;
     575             : struct stat;
     576             : struct statfs;
     577             : struct ucred;
     578             : struct uio;
     579             : struct vattr;
     580             : struct vnode;
     581             : 
     582             : /* vfs_subr */
     583             : int     bdevvp(dev_t, struct vnode **);
     584             : int     cdevvp(dev_t, struct vnode **);
     585             : struct vnode *checkalias(struct vnode *, dev_t, struct mount *);
     586             : int     getnewvnode(enum vtagtype, struct mount *, struct vops *,
     587             :             struct vnode **);
     588             : int     vaccess(enum vtype, mode_t, uid_t, gid_t, mode_t, struct ucred *);
     589             : void    vattr_null(struct vattr *);
     590             : void    vdevgone(int, int, int, enum vtype);
     591             : int     vcount(struct vnode *);
     592             : int     vfinddev(dev_t, enum vtype, struct vnode **);
     593             : void    vflushbuf(struct vnode *, int);
     594             : int     vflush(struct mount *, struct vnode *, int);
     595             : int     vget(struct vnode *, int);
     596             : void    vgone(struct vnode *);
     597             : void    vgonel(struct vnode *, struct proc *);
     598             : int     vinvalbuf(struct vnode *, int, struct ucred *, struct proc *,
     599             :             int, int);
     600             : void    vntblinit(void);
     601             : int     vwaitforio(struct vnode *, int, char *, int);
     602             : void    vwakeup(struct vnode *);
     603             : void    vput(struct vnode *);
     604             : int     vrecycle(struct vnode *, struct proc *);
     605             : int     vrele(struct vnode *);
     606             : void    vref(struct vnode *);
     607             : void    vprint(char *, struct vnode *);
     608             : void    copy_statfs_info(struct statfs *, const struct mount *);
     609             : 
     610             : /* vfs_getcwd.c */
     611             : #define GETCWD_CHECK_ACCESS 0x0001
     612             : int vfs_getcwd_scandir(struct vnode **, struct vnode **, char **, char *,
     613             :     struct proc *);
     614             : int vfs_getcwd_common(struct vnode *, struct vnode *, char **, char *, int,
     615             :     int, struct proc *);
     616             : int vfs_getcwd_getcache(struct vnode **, struct vnode **, char **, char *);
     617             : 
     618             : /* vfs_default.c */
     619             : int     vop_generic_abortop(void *);
     620             : int     vop_generic_bmap(void *);
     621             : int     vop_generic_bwrite(void *);
     622             : int     vop_generic_islocked(void *);
     623             : int     vop_generic_lock(void *);
     624             : int     vop_generic_unlock(void *);
     625             : int     vop_generic_revoke(void *);
     626             : int     vop_generic_kqfilter(void *);
     627             : int     vop_generic_lookup(void *);
     628             : 
     629             : /* vfs_vnops.c */
     630             : int     vn_isunder(struct vnode *, struct vnode *, struct proc *);
     631             : int     vn_close(struct vnode *, int, struct ucred *, struct proc *);
     632             : int     vn_open(struct nameidata *, int, int);
     633             : int     vn_rdwr(enum uio_rw, struct vnode *, caddr_t, int, off_t,
     634             :             enum uio_seg, int, struct ucred *, size_t *, struct proc *);
     635             : int     vn_stat(struct vnode *, struct stat *, struct proc *);
     636             : int     vn_statfile(struct file *, struct stat *, struct proc *);
     637             : int     vn_lock(struct vnode *, int);
     638             : int     vn_writechk(struct vnode *);
     639             : int     vn_fsizechk(struct vnode *, struct uio *, int, ssize_t *);
     640             : int     vn_ioctl(struct file *, u_long, caddr_t, struct proc *);
     641             : void    vn_marktext(struct vnode *);
     642             : 
     643             : /* vfs_sync.c */
     644             : void    syncer_thread(void *);
     645             : void    vn_initialize_syncerd(void);
     646             : void    vn_syncer_add_to_worklist(struct vnode *, int);
     647             : 
     648             : /* misc */
     649             : int     vn_isdisk(struct vnode *, int *);
     650             : int     softdep_fsync(struct vnode *);
     651             : int     getvnode(struct proc *, int, struct file **);
     652             : 
     653             : /* uvm */
     654             : void    uvm_vnp_setsize(struct vnode *, off_t);
     655             : void    uvm_vnp_sync(struct mount *);
     656             : void    uvm_vnp_terminate(struct vnode *);
     657             : int     uvm_vnp_uncache(struct vnode *);
     658             : 
     659             : 
     660             : #endif /* _KERNEL */
     661             : #endif /* _SYS_VNODE_H_ */

Generated by: LCOV version 1.13