Lines Matching defs:fsp
216 extern void hsched_init(struct hsfs *fsp, int fsid,
219 extern void hsfs_init_kstats(struct hsfs *fsp, int fsid);
220 extern void hsfs_fini_kstats(struct hsfs *fsp);
232 static int hs_getrootvp(struct vfs *vfsp, struct hsfs *fsp, size_t pathsize);
233 static int hs_findhsvol(struct hsfs *fsp, struct vnode *vp,
235 static int hs_parsehsvol(struct hsfs *fsp, uchar_t *volp,
237 static int hs_findisovol(struct hsfs *fsp, struct vnode *vp,
242 static int hs_parseisovol(struct hsfs *fsp, uchar_t *volp,
371 struct hsfs *fsp;
383 fsp = VFS_TO_HSFS(vfsp);
385 if (fsp->hsfs_rootvp->v_count != 1)
394 if (*tspp == fsp)
403 *tspp = fsp->hsfs_next;
407 hsfs_fini_kstats(fsp);
408 (void) VOP_CLOSE(fsp->hsfs_devvp, FREAD, 1, (offset_t)0, cr, NULL);
409 VN_RELE(fsp->hsfs_devvp);
411 if (fsp->hsfs_ptbl != NULL)
412 kmem_free(fsp->hsfs_ptbl, (size_t)fsp->hsfs_vol.ptbl_len);
414 if (fsp->hsfs_ptbl_idx != NULL)
415 kmem_free(fsp->hsfs_ptbl_idx, (size_t)
416 (fsp->hsfs_ptbl_idx_size * sizeof (struct ptable_idx)));
419 if (fsp->hsfs_fsmnt != NULL)
420 kmem_free(fsp->hsfs_fsmnt, strlen(fsp->hsfs_fsmnt) + 1);
422 hsched_fini(fsp->hqueue);
423 kmem_free(fsp->hqueue, sizeof (struct hsfs_queue));
425 mutex_destroy(&fsp->hsfs_free_lock);
426 rw_destroy(&fsp->hsfs_hash_lock);
428 kmem_free(fsp, sizeof (*fsp));
445 struct hsfs *fsp;
448 fsp = VFS_TO_HSFS(vfsp);
449 if (fsp->hsfs_magic != HSFS_MAGIC)
454 sbp->f_blocks = (fsblkcnt64_t)fsp->hsfs_vol.vol_size;
465 sbp->f_namemax = fsp->hsfs_namemax;
466 (void) strcpy(sbp->f_fstr, fsp->hsfs_vol.vol_id);
484 struct hsfs *fsp;
488 fsp = (struct hsfs *)VFS_TO_HSFS(vfsp);
496 rw_enter(&fsp->hsfs_hash_lock, RW_READER);
508 rw_exit(&fsp->hsfs_hash_lock);
513 rw_exit(&fsp->hsfs_hash_lock);
522 * We use the 'fsp' argument to determine the location of the root
526 compute_cdrom_id(struct hsfs *fsp, vnode_t *devvp)
529 struct hs_volume *hsvp = &fsp->hsfs_vol;
578 struct hsfs *fsp = NULL;
660 fsp = kmem_zalloc(sizeof (*fsp), KM_SLEEP);
665 fsp->hsfs_vol.vol_uid = hsfs_default_uid;
666 fsp->hsfs_vol.vol_gid = hsfs_default_gid;
667 fsp->hsfs_vol.vol_prot = hsfs_default_mode;
683 fsp->hsfs_namemax = ISO_FILE_NAMELEN;
684 fsp->hsfs_namelen = ISO_FILE_NAMELEN;
685 error = hs_findisovol(fsp, devvp, &fsp->hsfs_vol, svp, jvp);
687 error = hs_findhsvol(fsp, devvp, &fsp->hsfs_vol);
693 struct hsfs *, fsp,
694 struct hs_volume *, &fsp->hsfs_vol,
706 fsid = compute_cdrom_id(fsp, devvp);
722 fsp->hsfs_next = hs_mounttab;
723 hs_mounttab = fsp;
725 fsp->hsfs_devvp = devvp;
726 fsp->hsfs_vfs = vfsp;
727 fsp->hsfs_fsmnt = kmem_alloc(pathbufsz, KM_SLEEP);
728 (void) strlcpy(fsp->hsfs_fsmnt, path, pathbufsz);
730 mutex_init(&fsp->hsfs_free_lock, NULL, MUTEX_DEFAULT, NULL);
731 rw_init(&fsp->hsfs_hash_lock, NULL, RW_DEFAULT, NULL);
733 vfsp->vfs_data = (caddr_t)fsp;
736 vfsp->vfs_bsize = fsp->hsfs_vol.lbn_size; /* %% */
740 if (!hs_getrootvp(vfsp, fsp, pathbufsz)) {
741 DTRACE_PROBE1(rootvp__failed, struct hsfs *, fsp);
745 DTRACE_PROBE1(rootvp, struct hsfs *, fsp);
751 hp = VTOH(fsp->hsfs_rootvp);
752 hs_check_root_dirent(fsp->hsfs_rootvp, &(hp->hs_dirent));
755 has_rrip = IS_RRIP_IMPLEMENTED(fsp);
759 DTRACE_PROBE4(voltype__suggested, struct hsfs *, fsp,
762 DTRACE_PROBE4(voltype__actual, struct hsfs *, fsp,
766 struct hsfs *, fsp,
767 struct hs_volume *, &fsp->hsfs_vol,
780 DTRACE_PROBE4(voltype__force_off, struct hsfs *, fsp,
794 VN_RELE(fsp->hsfs_rootvp);
795 bcopy(svp, &fsp->hsfs_vol, sizeof (struct hs_volume));
796 fsp->hsfs_vol_type = HS_VOL_TYPE_ISO_V2;
797 vfsp->vfs_bsize = fsp->hsfs_vol.lbn_size;
801 VN_RELE(fsp->hsfs_rootvp);
802 bcopy(jvp, &fsp->hsfs_vol, sizeof (struct hs_volume));
803 fsp->hsfs_vol_type = HS_VOL_TYPE_JOLIET;
804 vfsp->vfs_bsize = fsp->hsfs_vol.lbn_size;
814 UNSET_IMPL_BIT(fsp, RRIP_BIT);
815 UNSET_SUSP_BIT(fsp);
818 if (!hs_getrootvp(vfsp, fsp, pathbufsz)) {
819 DTRACE_PROBE1(rootvp__failed, struct hsfs *, fsp);
823 DTRACE_PROBE1(rootvp, struct hsfs *, fsp);
825 if (IS_RRIP_IMPLEMENTED(fsp)) {
833 DTRACE_PROBE4(voltype__taken, struct hsfs *, fsp,
839 fsp->hsfs_rootvp->v_flag |= VROOT;
843 fsp->hsfs_rootvp->v_rdev = devvp->v_rdev;
844 rootvp = fsp->hsfs_rootvp;
847 if (IS_RRIP_IMPLEMENTED(fsp)) {
853 fsp->hsfs_namemax = RRIP_FILE_NAMELEN;
854 fsp->hsfs_namelen = RRIP_FILE_NAMELEN;
860 } else switch (fsp->hsfs_vol_type) {
869 fsp->hsfs_namemax = ISO_NAMELEN_V2_MAX;
870 fsp->hsfs_namelen = ISO_FILE_NAMELEN;
882 fsp->hsfs_namemax = ISO_NAMELEN_V2_MAX;
883 fsp->hsfs_namelen = ISO_NAMELEN_V2;
896 fsp->hsfs_namemax = JOLIET_NAMELEN_MAX*3; /* UTF-8 */
898 fsp->hsfs_namemax = MAXNAMELEN-1;
899 fsp->hsfs_namelen = JOLIET_NAMELEN*2;
909 fsp->hsfs_flags = mount_flags | (fsp->hsfs_flags & HSFSMNT_INODE);
915 fsp->hqueue = kmem_alloc(sizeof (struct hsfs_queue), KM_SLEEP);
916 hsched_init(fsp, fsid, &modlinkage);
922 hsfs_init_kstats(fsp, fsid);
924 DTRACE_PROBE1(mount__done, struct hsfs *, fsp);
929 fsp->hsfs_magic = HSFS_MAGIC;
940 if (fsp)
941 kmem_free(fsp, sizeof (*fsp));
950 * Get the rootvp associated with fsp->hsfs_vol
955 struct hsfs *fsp,
960 ASSERT(pathsize == strlen(fsp->hsfs_fsmnt) + 1);
968 if (!hsfs_valid_dir(&fsp->hsfs_vol.root_dir)) {
969 hs_log_bogus_disk_warning(fsp, HSFS_ERR_BAD_ROOT_DIR, 0);
970 if (hs_remakenode(fsp->hsfs_vol.root_dir.ext_lbn,
971 (uint_t)0, vfsp, &fsp->hsfs_rootvp)) {
973 mutex_destroy(&fsp->hsfs_free_lock);
974 rw_destroy(&fsp->hsfs_hash_lock);
975 kmem_free(fsp->hsfs_fsmnt, pathsize);
980 fsp->hsfs_rootvp = hs_makenode(&fsp->hsfs_vol.root_dir,
981 fsp->hsfs_vol.root_dir.ext_lbn, 0, vfsp);
985 fsp->hsfs_ptbl = NULL;
986 hp = VTOH(fsp->hsfs_rootvp);
1001 hs_findhsvol(struct hsfs *fsp, struct vnode *vp, struct hs_volume *hvp)
1036 fsp->hsfs_vol_type = HS_VOL_TYPE_HS;
1037 error = hs_parsehsvol(fsp, volp, hvp);
1077 hs_parsehsvol(struct hsfs *fsp, uchar_t *volp, struct hs_volume *hvp)
1112 return (hs_parsedir(fsp, HSV_ROOT_DIR(volp), &hvp->root_dir,
1124 * Except for fsp->hsfs_vol_type, no fsp member may be modified.
1125 * fsp->hsfs_vol is modified indirectly via the *hvp argument.
1128 hs_findisovol(struct hsfs *fsp, struct vnode *vp,
1170 fsp->hsfs_vol_type = HS_VOL_TYPE_ISO;
1171 if (error = hs_parseisovol(fsp, volp, hvp)) {
1184 fsp->hsfs_vol_type = HS_VOL_TYPE_ISO;
1185 if (error = hs_parseisovol(fsp, volp, svp)) {
1192 fsp->hsfs_vol_type = HS_VOL_TYPE_ISO;
1193 if (error = hs_parseisovol(fsp, volp, jvp)) {
1250 fsp->hsfs_flags |= HSFSMNT_INODE;
1294 hs_parseisovol(struct hsfs *fsp, uchar_t *volp, struct hs_volume *hvp)
1329 return (hs_parsedir(fsp, ISO_ROOT_DIR(volp), &hvp->root_dir,
1459 struct hsfs *fsp;
1503 fsp = VFS_TO_HSFS(vfsp);
1504 fvolp = &fsp->hsfs_vol;