Print this page
6265 speed up mount/umount


 186  * Each zone also has its own list of mounts, containing filesystems mounted
 187  * somewhere within the filesystem tree rooted at the zone's rootpath.  The
 188  * list is doubly linked to match the global list.
 189  *
 190  * mnttab locking: the in-kernel mnttab uses the vfs_mntpt, vfs_resource and
 191  * vfs_mntopts fields in the vfs_t. mntpt and resource are refstr_ts that
 192  * are set at mount time and can only be modified during a remount.
 193  * It is safe to read these fields if you can prevent a remount on the vfs,
 194  * or through the convenience funcs vfs_getmntpoint() and vfs_getresource().
 195  * The mntopts field may only be accessed through the provided convenience
 196  * functions, as it is protected by the vfs list lock. Modifying a mount
 197  * option requires grabbing the vfs list write lock, which can be a very
 198  * high latency lock.
 199  */
 200 struct zone;            /* from zone.h */
 201 struct fem_head;        /* from fem.h */
 202 
 203 typedef struct vfs {
 204         struct vfs      *vfs_next;              /* next VFS in VFS list */
 205         struct vfs      *vfs_prev;              /* prev VFS in VFS list */







 206 
 207 /* vfs_op should not be used directly.  Accessor functions are provided */
 208         vfsops_t        *vfs_op;                /* operations on VFS */
 209 
 210         struct vnode    *vfs_vnodecovered;      /* vnode mounted on */
 211         uint_t          vfs_flag;               /* flags */
 212         uint_t          vfs_bsize;              /* native block size */
 213         int             vfs_fstype;             /* file system type index */
 214         fsid_t          vfs_fsid;               /* file system id */
 215         void            *vfs_data;              /* private data */
 216         dev_t           vfs_dev;                /* device of mounted VFS */
 217         ulong_t         vfs_bcount;             /* I/O count (accounting) */
 218         struct vfs      *vfs_list;              /* sync list pointer */
 219         struct vfs      *vfs_hash;              /* hash list pointer */
 220         ksema_t         vfs_reflock;            /* mount/unmount/sync lock */
 221         uint_t          vfs_count;              /* vfs reference count */
 222         mntopts_t       vfs_mntopts;            /* options mounted with */
 223         refstr_t        *vfs_resource;          /* mounted resource name */
 224         refstr_t        *vfs_mntpt;             /* mount point name */
 225         time_t          vfs_mtime;              /* time we were mounted */




 186  * Each zone also has its own list of mounts, containing filesystems mounted
 187  * somewhere within the filesystem tree rooted at the zone's rootpath.  The
 188  * list is doubly linked to match the global list.
 189  *
 190  * mnttab locking: the in-kernel mnttab uses the vfs_mntpt, vfs_resource and
 191  * vfs_mntopts fields in the vfs_t. mntpt and resource are refstr_ts that
 192  * are set at mount time and can only be modified during a remount.
 193  * It is safe to read these fields if you can prevent a remount on the vfs,
 194  * or through the convenience funcs vfs_getmntpoint() and vfs_getresource().
 195  * The mntopts field may only be accessed through the provided convenience
 196  * functions, as it is protected by the vfs list lock. Modifying a mount
 197  * option requires grabbing the vfs list write lock, which can be a very
 198  * high latency lock.
 199  */
 200 struct zone;            /* from zone.h */
 201 struct fem_head;        /* from fem.h */
 202 
 203 typedef struct vfs {
 204         struct vfs      *vfs_next;              /* next VFS in VFS list */
 205         struct vfs      *vfs_prev;              /* prev VFS in VFS list */
 206         avl_node_t      vfs_avldev;             /* by dev index */
 207         avl_node_t      vfs_avlmntpnt;          /* by mntpnt index */
 208         /*
 209          * global mount count to define an order on entries in
 210          * the avl trees with same dev/mountpoint
 211          */
 212         uint64_t        vfs_mntix;
 213 
 214 /* vfs_op should not be used directly.  Accessor functions are provided */
 215         vfsops_t        *vfs_op;                /* operations on VFS */
 216 
 217         struct vnode    *vfs_vnodecovered;      /* vnode mounted on */
 218         uint_t          vfs_flag;               /* flags */
 219         uint_t          vfs_bsize;              /* native block size */
 220         int             vfs_fstype;             /* file system type index */
 221         fsid_t          vfs_fsid;               /* file system id */
 222         void            *vfs_data;              /* private data */
 223         dev_t           vfs_dev;                /* device of mounted VFS */
 224         ulong_t         vfs_bcount;             /* I/O count (accounting) */
 225         struct vfs      *vfs_list;              /* sync list pointer */
 226         struct vfs      *vfs_hash;              /* hash list pointer */
 227         ksema_t         vfs_reflock;            /* mount/unmount/sync lock */
 228         uint_t          vfs_count;              /* vfs reference count */
 229         mntopts_t       vfs_mntopts;            /* options mounted with */
 230         refstr_t        *vfs_resource;          /* mounted resource name */
 231         refstr_t        *vfs_mntpt;             /* mount point name */
 232         time_t          vfs_mtime;              /* time we were mounted */