Lines Matching defs:fs
51 libuvfs_init_callbacks(libuvfs_fs_t *fs)
57 fs->fs_callback[i].lcr_callback = NULL;
60 fs->fs_callback[reg->lcr_optag] = *reg;
64 libuvfs_fs_rand(libuvfs_fs_t *fs)
68 fs->fs_fid_random = rand();
76 fs->fs_fid_random ^= better;
83 libuvfs_fs_t *fs;
88 fs = umem_cache_alloc(libuvfs_fs_cache, UMEM_NOFAIL);
90 fs->fs_dev = -1;
91 fs->fs_fsid = fsid;
93 fs->fs_io_maxread = 0;
94 fs->fs_io_maxwrite = 0;
95 fs->fs_max_dthreads = 0;
96 fs->fs_cur_dthreads = 0;
98 libuvfs_init_callbacks(fs);
100 fs->fs_door = -1;
102 fs->fs_scf_handle = NULL;
103 fs->fs_scf_error = 0;
104 fs->fs_scf_props = NULL;
105 fs->fs_daemon_fmri_size = 0;
106 fs->fs_daemon_fmri = NULL;
108 if (fs->fs_fsid == LIBUVFS_FSID_SVC)
109 libuvfs_get_daemon_fsid(fs);
111 libuvfs_fs_rand(fs);
112 fs->fs_fid_seq = 1;
114 return (fs);
118 libuvfs_destroy_fs(libuvfs_fs_t *fs)
120 if (fs->fs_dev >= 0)
121 (void) close(fs->fs_dev);
122 if (fs->fs_door >= 0)
123 (void) close(fs->fs_door);
125 if (fs->fs_scf_props != NULL)
126 scf_simple_app_props_free(fs->fs_scf_props);
127 if (fs->fs_scf_handle != NULL)
128 scf_handle_destroy(fs->fs_scf_handle);
129 if (fs->fs_daemon_fmri != NULL)
130 umem_free(fs->fs_daemon_fmri, fs->fs_daemon_fmri_size);
132 umem_cache_free(libuvfs_fs_cache, fs);
139 libuvfs_fs_t *fs = vfs;
141 (void) mutex_init(&fs->fs_lock, USYNC_THREAD, NULL);
142 (void) mutex_init(&fs->fs_stash_lock, USYNC_THREAD, NULL);
143 (void) mutex_init(&fs->fs_name_lock, USYNC_THREAD, NULL);
144 (void) cond_init(&fs->fs_daemon_cv, USYNC_THREAD, NULL);
145 (void) pthread_attr_init(&fs->fs_pthread_attr);
146 libuvfs_stash_fs_construct(fs);
147 libuvfs_name_fs_construct(fs);
156 libuvfs_fs_t *fs = vfs;
158 libuvfs_name_fs_destroy(fs);
159 libuvfs_stash_fs_destroy(fs);
160 (void) pthread_attr_destroy(&fs->fs_pthread_attr);
161 (void) cond_destroy(&fs->fs_daemon_cv);
162 (void) mutex_destroy(&fs->fs_stash_lock);
163 (void) mutex_destroy(&fs->fs_lock);