Print this page
basic FSH


 181  * "rootvfs".
 182  * File system implementations should not access this list;
 183  * it's intended for use only in the kernel's vfs layer.
 184  *
 185  * Each zone also has its own list of mounts, containing filesystems mounted
 186  * somewhere within the filesystem tree rooted at the zone's rootpath.  The
 187  * list is doubly linked to match the global list.
 188  *
 189  * mnttab locking: the in-kernel mnttab uses the vfs_mntpt, vfs_resource and
 190  * vfs_mntopts fields in the vfs_t. mntpt and resource are refstr_ts that
 191  * are set at mount time and can only be modified during a remount.
 192  * It is safe to read these fields if you can prevent a remount on the vfs,
 193  * or through the convenience funcs vfs_getmntpoint() and vfs_getresource().
 194  * The mntopts field may only be accessed through the provided convenience
 195  * functions, as it is protected by the vfs list lock. Modifying a mount
 196  * option requires grabbing the vfs list write lock, which can be a very
 197  * high latency lock.
 198  */
 199 struct zone;            /* from zone.h */
 200 struct fem_head;        /* from fem.h */

 201 
 202 typedef struct vfs {
 203         struct vfs      *vfs_next;              /* next VFS in VFS list */
 204         struct vfs      *vfs_prev;              /* prev VFS in VFS list */
 205 
 206 /* vfs_op should not be used directly.  Accessor functions are provided */
 207         vfsops_t        *vfs_op;                /* operations on VFS */
 208 
 209         struct vnode    *vfs_vnodecovered;      /* vnode mounted on */
 210         uint_t          vfs_flag;               /* flags */
 211         uint_t          vfs_bsize;              /* native block size */
 212         int             vfs_fstype;             /* file system type index */
 213         fsid_t          vfs_fsid;               /* file system id */
 214         void            *vfs_data;              /* private data */
 215         dev_t           vfs_dev;                /* device of mounted VFS */
 216         ulong_t         vfs_bcount;             /* I/O count (accounting) */
 217         struct vfs      *vfs_list;              /* sync list pointer */
 218         struct vfs      *vfs_hash;              /* hash list pointer */
 219         ksema_t         vfs_reflock;            /* mount/unmount/sync lock */
 220         uint_t          vfs_count;              /* vfs reference count */
 221         mntopts_t       vfs_mntopts;            /* options mounted with */
 222         refstr_t        *vfs_resource;          /* mounted resource name */
 223         refstr_t        *vfs_mntpt;             /* mount point name */
 224         time_t          vfs_mtime;              /* time we were mounted */
 225         struct vfs_impl *vfs_implp;             /* impl specific data */
 226         /*
 227          * Zones support.  Note that the zone that "owns" the mount isn't
 228          * necessarily the same as the zone in which the zone is visible.
 229          * That is, vfs_zone and (vfs_zone_next|vfs_zone_prev) may refer to
 230          * different zones.
 231          */
 232         struct zone     *vfs_zone;              /* zone that owns the mount */
 233         struct vfs      *vfs_zone_next;         /* next VFS visible in zone */
 234         struct vfs      *vfs_zone_prev;         /* prev VFS visible in zone */
 235 
 236         struct fem_head *vfs_femhead;           /* fs monitoring */
 237         minor_t         vfs_lofi_minor;         /* minor if lofi mount */



 238 } vfs_t;
 239 
 240 #define vfs_featureset  vfs_implp->vi_featureset
 241 #define vfs_vskap       vfs_implp->vi_vskap
 242 #define vfs_fstypevsp   vfs_implp->vi_fstypevsp
 243 #define vfs_vopstats    vfs_implp->vi_vopstats
 244 #define vfs_hrctime     vfs_implp->vi_hrctime
 245 
 246 /*
 247  * VFS flags.
 248  */
 249 #define VFS_RDONLY      0x01            /* read-only vfs */
 250 #define VFS_NOMNTTAB    0x02            /* vfs not seen in mnttab */
 251 #define VFS_NOSETUID    0x08            /* setuid disallowed */
 252 #define VFS_REMOUNT     0x10            /* modify mount options only */
 253 #define VFS_NOTRUNC     0x20            /* does not truncate long file names */
 254 #define VFS_UNLINKABLE  0x40            /* unlink(2) can be applied to root */
 255 #define VFS_PXFS        0x80            /* clustering: global fs proxy vfs */
 256 #define VFS_UNMOUNTED   0x100           /* file system has been unmounted */
 257 #define VFS_NBMAND      0x200           /* allow non-blocking mandatory locks */




 181  * "rootvfs".
 182  * File system implementations should not access this list;
 183  * it's intended for use only in the kernel's vfs layer.
 184  *
 185  * Each zone also has its own list of mounts, containing filesystems mounted
 186  * somewhere within the filesystem tree rooted at the zone's rootpath.  The
 187  * list is doubly linked to match the global list.
 188  *
 189  * mnttab locking: the in-kernel mnttab uses the vfs_mntpt, vfs_resource and
 190  * vfs_mntopts fields in the vfs_t. mntpt and resource are refstr_ts that
 191  * are set at mount time and can only be modified during a remount.
 192  * It is safe to read these fields if you can prevent a remount on the vfs,
 193  * or through the convenience funcs vfs_getmntpoint() and vfs_getresource().
 194  * The mntopts field may only be accessed through the provided convenience
 195  * functions, as it is protected by the vfs list lock. Modifying a mount
 196  * option requires grabbing the vfs list write lock, which can be a very
 197  * high latency lock.
 198  */
 199 struct zone;            /* from zone.h */
 200 struct fem_head;        /* from fem.h */
 201 struct fsh_fsrecord;    /* from fsh_impl.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 */
 226         struct vfs_impl *vfs_implp;             /* impl specific data */
 227         /*
 228          * Zones support.  Note that the zone that "owns" the mount isn't
 229          * necessarily the same as the zone in which the zone is visible.
 230          * That is, vfs_zone and (vfs_zone_next|vfs_zone_prev) may refer to
 231          * different zones.
 232          */
 233         struct zone     *vfs_zone;              /* zone that owns the mount */
 234         struct vfs      *vfs_zone_next;         /* next VFS visible in zone */
 235         struct vfs      *vfs_zone_prev;         /* prev VFS visible in zone */
 236 
 237         struct fem_head *vfs_femhead;           /* fs monitoring */
 238         minor_t         vfs_lofi_minor;         /* minor if lofi mount */
 239 
 240         struct fsh_fsrecord *volatile
 241                 vfs_fshrecord;                  /* fs hooking */
 242 } vfs_t;
 243 
 244 #define vfs_featureset  vfs_implp->vi_featureset
 245 #define vfs_vskap       vfs_implp->vi_vskap
 246 #define vfs_fstypevsp   vfs_implp->vi_fstypevsp
 247 #define vfs_vopstats    vfs_implp->vi_vopstats
 248 #define vfs_hrctime     vfs_implp->vi_hrctime
 249 
 250 /*
 251  * VFS flags.
 252  */
 253 #define VFS_RDONLY      0x01            /* read-only vfs */
 254 #define VFS_NOMNTTAB    0x02            /* vfs not seen in mnttab */
 255 #define VFS_NOSETUID    0x08            /* setuid disallowed */
 256 #define VFS_REMOUNT     0x10            /* modify mount options only */
 257 #define VFS_NOTRUNC     0x20            /* does not truncate long file names */
 258 #define VFS_UNLINKABLE  0x40            /* unlink(2) can be applied to root */
 259 #define VFS_PXFS        0x80            /* clustering: global fs proxy vfs */
 260 #define VFS_UNMOUNTED   0x100           /* file system has been unmounted */
 261 #define VFS_NBMAND      0x200           /* allow non-blocking mandatory locks */