xref: /minix3/minix/servers/vfs/vnode.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #ifndef __VFS_VNODE_H__
2*433d6423SLionel Sambuc #define __VFS_VNODE_H__
3*433d6423SLionel Sambuc 
4*433d6423SLionel Sambuc EXTERN struct vnode {
5*433d6423SLionel Sambuc   endpoint_t v_fs_e;            /* FS process' endpoint number */
6*433d6423SLionel Sambuc   endpoint_t v_mapfs_e;		/* mapped FS process' endpoint number */
7*433d6423SLionel Sambuc   ino_t v_inode_nr;		/* inode number on its (minor) device */
8*433d6423SLionel Sambuc   ino_t v_mapinode_nr;		/* mapped inode number of mapped FS. */
9*433d6423SLionel Sambuc   mode_t v_mode;		/* file type, protection, etc. */
10*433d6423SLionel Sambuc   uid_t v_uid;			/* uid of inode. */
11*433d6423SLionel Sambuc   gid_t v_gid;			/* gid of inode. */
12*433d6423SLionel Sambuc   off_t v_size;			/* current file size in bytes */
13*433d6423SLionel Sambuc   int v_ref_count;		/* # times vnode used; 0 means slot is free */
14*433d6423SLionel Sambuc   int v_fs_count;		/* # reference at the underlying FS */
15*433d6423SLionel Sambuc   int v_mapfs_count;		/* # reference at the underlying mapped FS */
16*433d6423SLionel Sambuc   endpoint_t v_bfs_e;		/* endpoint number for the FS proces in case
17*433d6423SLionel Sambuc 				   of a block special file */
18*433d6423SLionel Sambuc   dev_t v_dev;                  /* device number on which the corresponding
19*433d6423SLionel Sambuc                                    inode resides */
20*433d6423SLionel Sambuc   dev_t v_sdev;                 /* device number for special files */
21*433d6423SLionel Sambuc   struct vmnt *v_vmnt;          /* vmnt object of the partition */
22*433d6423SLionel Sambuc   tll_t v_lock;			/* three-level-lock */
23*433d6423SLionel Sambuc } vnode[NR_VNODES];
24*433d6423SLionel Sambuc 
25*433d6423SLionel Sambuc /* vnode lock types mapping */
26*433d6423SLionel Sambuc #define VNODE_NONE TLL_NONE	/* used only for get_filp2 to avoid locking */
27*433d6423SLionel Sambuc #define VNODE_READ TLL_READ
28*433d6423SLionel Sambuc #define VNODE_OPCL TLL_READSER
29*433d6423SLionel Sambuc #define VNODE_WRITE TLL_WRITE
30*433d6423SLionel Sambuc #endif
31