Lines Matching refs:fs

36 libuvfs_scf_error(const libuvfs_fs_t *fs, scf_error_t *errnum)
39 *errnum = fs->fs_scf_error;
41 return (scf_strerror(fs->fs_scf_error));
45 libuvfs_set_svc_info(libuvfs_fs_t *fs)
47 if (fs->fs_scf_handle != NULL)
50 fs->fs_scf_handle = scf_handle_create(SCF_VERSION);
51 if (fs->fs_scf_handle == NULL) {
52 fs->fs_scf_error = scf_error();
56 if (scf_handle_bind(fs->fs_scf_handle) != 0)
57 fs->fs_scf_error = scf_error();
68 fs->fs_daemon_fmri_size = scf_limit(SCF_LIMIT_MAX_FMRI_LENGTH);
69 fs->fs_daemon_fmri = umem_alloc(fs->fs_daemon_fmri_size, UMEM_NOFAIL);
70 fs->fs_daemon_fmri[0] = '\0';
71 if (scf_myname(fs->fs_scf_handle, fs->fs_daemon_fmri,
72 fs->fs_daemon_fmri_size) != -1)
73 fs->fs_scf_props = scf_simple_app_props_get(fs->fs_scf_handle,
74 fs->fs_daemon_fmri);
76 if (fs->fs_scf_props == NULL)
77 fs->fs_scf_error = scf_error();
107 libuvfs_get_daemon_executable(libuvfs_fs_t *fs)
112 libuvfs_set_svc_info(fs);
113 if (fs->fs_scf_props == NULL) {
114 fs->fs_scf_error = scf_error();
118 prop = scf_simple_app_props_search(fs->fs_scf_props, "filesys",
134 libuvfs_get_daemon_fsid(libuvfs_fs_t *fs)
139 libuvfs_set_svc_info(fs);
140 if (fs->fs_scf_props == NULL) {
141 fs->fs_scf_error = scf_error();
145 prop = scf_simple_app_props_search(fs->fs_scf_props, "filesys", "fsid");
153 fs->fs_fsid = *((uint64_t *)found_fsid);
219 libuvfs_daemon_launch(libuvfs_fs_t *fs, const char *special,
240 libuvfs_set_svc_info(fs);
242 service = scf_service_create(fs->fs_scf_handle);
247 instance = scf_instance_create(fs->fs_scf_handle);
253 rc = scf_handle_decode_fmri(fs->fs_scf_handle, LIBUVFS_SERVER_FMRI,
272 pg = scf_pg_create(fs->fs_scf_handle);
282 trans = scf_transaction_create(fs->fs_scf_handle);
308 rc = scf_instance_to_fmri(instance, fs->fs_daemon_fmri,
309 fs->fs_daemon_fmri_size);
313 rc = smf_refresh_instance(fs->fs_daemon_fmri);
316 rc = smf_enable_instance(fs->fs_daemon_fmri, 0);
320 fs->fs_scf_error = scf_error();
337 libuvfs_daemon_exit(libuvfs_fs_t *fs)
339 libuvfs_set_svc_info(fs);
340 if ((fs->fs_daemon_fmri == NULL) || (fs->fs_daemon_fmri[0] == '\0'))
343 (void) smf_disable_instance(fs->fs_daemon_fmri, 0);
351 libuvfs_fs_t *fs;
353 fs = libuvfs_create_fs(LIBUVFS_VERSION, LIBUVFS_FSID_NONE);
354 libuvfs_set_svc_info(fs);
355 if (fs->fs_daemon_fmri)
356 (void) smf_disable_instance(fs->fs_daemon_fmri, 0);
360 libuvfs_remove_disabled_instances(libuvfs_fs_t *fs)
370 libuvfs_set_svc_info(fs);
371 if (fs->fs_scf_handle == NULL)
374 service = scf_service_create(fs->fs_scf_handle);
375 rc = scf_handle_decode_fmri(fs->fs_scf_handle, LIBUVFS_SERVER_FMRI,
380 iter = scf_iter_create(fs->fs_scf_handle);
385 instance = scf_instance_create(fs->fs_scf_handle);
397 prop = scf_simple_prop_get(fs->fs_scf_handle, inst_fmri,
411 prop = scf_simple_prop_get(fs->fs_scf_handle, inst_fmri,
427 fs->fs_scf_error = scf_error();