next up previous contents
Next: 8.2 struct vfsops Up: 8. Appendix: Vnode Interface Previous: 8. Appendix: Vnode Interface

   
8.1 struct vfs

An instance of the vfs structure exists in a running kernel for each mounted file system. All of these instances are chained together in a singly-linked list. The head of the list is a global variable called root_vp, which contains the vfs for the root device. The field vfs_next links one vfs structure to the following one in the list.


  
Figure: SunOS 5.x VFS Interface

Figure: SunOS 5.x VFS Interface


typedef struct vfs {
  struct vfs      *vfs_next;              /* next VFS in VFS list */
  struct vfsops   *vfs_op;                /* operations on VFS */
  struct vnode    *vfs_vnodecovered;      /* vnode mounted on */
  u_long          vfs_flag;               /* flags */
  u_long          vfs_bsize;              /* native block size */
  int             vfs_fstype;             /* file system type index */
  fsid_t          vfs_fsid;               /* file system id */
  caddr_t         vfs_data;               /* private data */
  dev_t           vfs_dev;                /* device of mounted VFS */
  u_long          vfs_bcount;             /* I/O count (accounting) */
  u_short         vfs_nsubmounts;         /* immediate sub-mount count */
  struct vfs      *vfs_list;              /* sync list pointer */
  struct vfs      *vfs_hash;              /* hash list pointer */
  kmutex_t        vfs_reflock;            /* mount/unmount/sync lock */
} vfs_t;





5.3in


typedef struct vfs {
  struct vfs      *vfs_next;              /* next VFS in VFS list */
  struct vfsops   *vfs_op;                /* operations on VFS */
  struct vnode    *vfs_vnodecovered;      /* vnode mounted on */
  u_long          vfs_flag;               /* flags */
  u_long          vfs_bsize;              /* native block size */
  int             vfs_fstype;             /* file system type index */
  fsid_t          vfs_fsid;               /* file system id */
  caddr_t         vfs_data;               /* private data */
  dev_t           vfs_dev;                /* device of mounted VFS */
  u_long          vfs_bcount;             /* I/O count (accounting) */
  u_short         vfs_nsubmounts;         /* immediate sub-mount count */
  struct vfs      *vfs_list;              /* sync list pointer */
  struct vfs      *vfs_hash;              /* hash list pointer */
  kmutex_t        vfs_reflock;            /* mount/unmount/sync lock */
} vfs_t;

The fields relevant to this proposal are as follows:


next up previous contents
Next: 8.2 struct vfsops Up: 8. Appendix: Vnode Interface Previous: 8. Appendix: Vnode Interface
Erez Zadok
1999-12-07