Home
last modified time | relevance | path

Searched refs:spa (Results 1 – 25 of 69) sorted by relevance

123

/titanic_41/usr/src/uts/common/fs/zfs/
H A Dspa_misc.c352 spa_config_lock_init(spa_t *spa) in spa_config_lock_init() argument
355 spa_config_lock_t *scl = &spa->spa_config_lock[i]; in spa_config_lock_init()
365 spa_config_lock_destroy(spa_t *spa) in spa_config_lock_destroy() argument
368 spa_config_lock_t *scl = &spa->spa_config_lock[i]; in spa_config_lock_destroy()
378 spa_config_tryenter(spa_t *spa, int locks, void *tag, krw_t rw) in spa_config_tryenter() argument
381 spa_config_lock_t *scl = &spa->spa_config_lock[i]; in spa_config_tryenter()
388 spa_config_exit(spa, locks ^ (1 << i), tag); in spa_config_tryenter()
395 spa_config_exit(spa, locks ^ (1 << i), tag); in spa_config_tryenter()
407 spa_config_enter(spa_t *spa, int locks, void *tag, krw_t rw) in spa_config_enter() argument
414 spa_config_lock_t *scl = &spa->spa_config_lock[i]; in spa_config_enter()
[all …]
H A Dspa.c142 static boolean_t spa_has_active_shared_spare(spa_t *spa);
143 static int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
146 static void spa_vdev_resilver_done(spa_t *spa);
194 spa_prop_get_config(spa_t *spa, nvlist_t **nvp) in spa_prop_get_config() argument
196 vdev_t *rvd = spa->spa_root_vdev; in spa_prop_get_config()
197 dsl_pool_t *pool = spa->spa_dsl_pool; in spa_prop_get_config()
201 metaslab_class_t *mc = spa_normal_class(spa); in spa_prop_get_config()
203 ASSERT(MUTEX_HELD(&spa->spa_props_lock)); in spa_prop_get_config()
206 alloc = metaslab_class_get_alloc(spa_normal_class(spa)); in spa_prop_get_config()
207 size = metaslab_class_get_space(spa_normal_class(spa)); in spa_prop_get_config()
[all …]
H A Dspa_errlog.c93 spa_log_error(spa_t *spa, zio_t *zio) in spa_log_error() argument
105 if (spa_load_state(spa) == SPA_LOAD_TRYIMPORT) in spa_log_error()
108 mutex_enter(&spa->spa_errlist_lock); in spa_log_error()
114 if (spa->spa_scrub_active || spa->spa_scrub_finished) in spa_log_error()
115 tree = &spa->spa_errlist_scrub; in spa_log_error()
117 tree = &spa->spa_errlist_last; in spa_log_error()
121 mutex_exit(&spa->spa_errlist_lock); in spa_log_error()
129 mutex_exit(&spa->spa_errlist_lock); in spa_log_error()
138 spa_get_errlog_size(spa_t *spa) in spa_get_errlog_size() argument
142 mutex_enter(&spa->spa_errlog_lock); in spa_get_errlog_size()
[all …]
H A Dzfeature.c174 spa_features_check(spa_t *spa, boolean_t for_write, in spa_features_check() argument
177 objset_t *os = spa->spa_meta_objset; in spa_features_check()
182 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in spa_features_check()
204 if (zap_lookup(os, spa->spa_feat_desc_obj, in spa_features_check()
226 feature_get_refcount(spa_t *spa, zfeature_info_t *feature, uint64_t *res) in feature_get_refcount() argument
229 if (spa->spa_feat_refcount_cache[feature->fi_feature] == in feature_get_refcount()
233 *res = spa->spa_feat_refcount_cache[feature->fi_feature]; in feature_get_refcount()
243 feature_get_refcount_from_disk(spa_t *spa, zfeature_info_t *feature, in feature_get_refcount_from_disk() argument
249 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in feature_get_refcount_from_disk()
258 err = zap_lookup(spa->spa_meta_objset, zapobj, in feature_get_refcount_from_disk()
[all …]
H A Dspa_config.c229 spa_t *spa = NULL; in spa_config_sync() local
237 while ((spa = spa_next(spa)) != NULL) { in spa_config_sync()
245 if ((spa == target && removing) || in spa_config_sync()
246 !spa_writeable(spa)) in spa_config_sync()
249 mutex_enter(&spa->spa_props_lock); in spa_config_sync()
250 tdp = list_head(&spa->spa_config_list); in spa_config_sync()
251 if (spa->spa_config == NULL || in spa_config_sync()
254 mutex_exit(&spa->spa_props_lock); in spa_config_sync()
262 VERIFY(nvlist_add_nvlist(nvl, spa->spa_name, in spa_config_sync()
263 spa->spa_config) == 0); in spa_config_sync()
[all …]
H A Dspa_history.c85 spa_history_create_obj(spa_t *spa, dmu_tx_t *tx) in spa_history_create_obj() argument
89 objset_t *mos = spa->spa_meta_objset; in spa_history_create_obj()
91 ASSERT(spa->spa_history == 0); in spa_history_create_obj()
92 spa->spa_history = dmu_object_alloc(mos, DMU_OT_SPA_HISTORY, in spa_history_create_obj()
98 &spa->spa_history, tx) == 0); in spa_history_create_obj()
100 VERIFY(0 == dmu_bonus_hold(mos, spa->spa_history, FTAG, &dbp)); in spa_history_create_obj()
111 metaslab_class_get_dspace(spa_normal_class(spa)) / 1000; in spa_history_create_obj()
122 spa_history_advance_bof(spa_t *spa, spa_history_phys_t *shpp) in spa_history_advance_bof() argument
124 objset_t *mos = spa->spa_meta_objset; in spa_history_advance_bof()
132 if ((err = dmu_read(mos, spa->spa_history, phys_bof, firstread, in spa_history_advance_bof()
[all …]
H A Dvdev.c151 vdev_lookup_top(spa_t *spa, uint64_t vdev) in vdev_lookup_top() argument
153 vdev_t *rvd = spa->spa_root_vdev; in vdev_lookup_top()
155 ASSERT(spa_config_held(spa, SCL_ALL, RW_READER) != 0); in vdev_lookup_top()
196 vdev_count_leaves(spa_t *spa) in vdev_count_leaves() argument
198 return (vdev_count_leaves_impl(spa->spa_root_vdev)); in vdev_count_leaves()
207 spa_t *spa = cvd->vdev_spa; in vdev_add_child() local
209 ASSERT(spa_config_held(spa, SCL_ALL, RW_WRITER) == SCL_ALL); in vdev_add_child()
310 vdev_alloc_common(spa_t *spa, uint_t id, uint64_t guid, vdev_ops_t *ops) in vdev_alloc_common() argument
316 if (spa->spa_root_vdev == NULL) { in vdev_alloc_common()
318 spa->spa_root_vdev = vd; in vdev_alloc_common()
[all …]
H A Dvdev_queue.c275 spa_t *spa = zio->io_spa; in vdev_queue_io_add() local
280 mutex_enter(&spa->spa_iokstat_lock); in vdev_queue_io_add()
281 spa->spa_queue_stats[zio->io_priority].spa_queued++; in vdev_queue_io_add()
282 if (spa->spa_iokstat != NULL) in vdev_queue_io_add()
283 kstat_waitq_enter(spa->spa_iokstat->ks_data); in vdev_queue_io_add()
284 mutex_exit(&spa->spa_iokstat_lock); in vdev_queue_io_add()
290 spa_t *spa = zio->io_spa; in vdev_queue_io_remove() local
295 mutex_enter(&spa->spa_iokstat_lock); in vdev_queue_io_remove()
296 ASSERT3U(spa->spa_queue_stats[zio->io_priority].spa_queued, >, 0); in vdev_queue_io_remove()
297 spa->spa_queue_stats[zio->io_priority].spa_queued--; in vdev_queue_io_remove()
[all …]
H A Dvdev_label.c215 vdev_config_generate(spa_t *spa, vdev_t *vd, boolean_t getstats, in vdev_config_generate() argument
250 spa_version(spa) >= SPA_VERSION_RAIDZ2) || in vdev_config_generate()
252 spa_version(spa) >= SPA_VERSION_RAIDZ3)); in vdev_config_generate()
309 if (spa_scan_get_stats(spa, &ps) == 0) { in vdev_config_generate()
337 child[idx++] = vdev_config_generate(spa, cvd, in vdev_config_generate()
399 vdev_top_config_generate(spa_t *spa, nvlist_t *config) in vdev_top_config_generate() argument
401 vdev_t *rvd = spa->spa_root_vdev; in vdev_top_config_generate()
436 spa_t *spa = vd->vdev_spa; in vdev_label_read_config() local
445 ASSERT(spa_config_held(spa, SCL_STATE_ALL, RW_WRITER) == SCL_STATE_ALL); in vdev_label_read_config()
456 zio = zio_root(spa, NULL, NULL, flags); in vdev_label_read_config()
[all …]
H A Dzfs_fm.c107 const char *subclass, spa_t *spa, vdev_t *vd, zio_t *zio, in zfs_ereport_start() argument
119 if (spa_load_state(spa) == SPA_LOAD_TRYIMPORT || in zfs_ereport_start()
120 spa_load_state(spa) == SPA_LOAD_RECOVER) in zfs_ereport_start()
128 if (spa_load_state(spa) != SPA_LOAD_NONE && in zfs_ereport_start()
129 spa->spa_last_open_failed) in zfs_ereport_start()
202 mutex_enter(&spa->spa_errlist_lock); in zfs_ereport_start()
209 if (spa_load_state(spa) != SPA_LOAD_NONE) { in zfs_ereport_start()
210 if (spa->spa_ena == 0) in zfs_ereport_start()
211 spa->spa_ena = fm_ena_generate(0, FM_ENA_FMT1); in zfs_ereport_start()
212 ena = spa->spa_ena; in zfs_ereport_start()
[all …]
H A Dddt.c59 spa_t *spa = ddt->ddt_spa; in ddt_object_create() local
74 VERIFY(zap_add(os, spa->spa_ddt_stat_object, name, in ddt_object_create()
83 spa_t *spa = ddt->ddt_spa; in ddt_object_destroy() local
94 VERIFY(zap_remove(os, spa->spa_ddt_stat_object, name, tx) == 0); in ddt_object_destroy()
353 spa_t *spa = ddt->ddt_spa; in ddt_stat_generate() local
369 dsize += dva_get_dsize_sync(spa, &ddp->ddp_dva[d]); in ddt_stat_generate()
443 ddt_get_dedup_object_stats(spa_t *spa, ddt_object_t *ddo_total) in ddt_get_dedup_object_stats() argument
447 ddt_t *ddt = spa->spa_ddt[c]; in ddt_get_dedup_object_stats()
468 ddt_get_dedup_histogram(spa_t *spa, ddt_histogram_t *ddh) in ddt_get_dedup_histogram() argument
471 ddt_t *ddt = spa->spa_ddt[c]; in ddt_get_dedup_histogram()
[all …]
H A Dzio.c498 zio_create(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp, in zio_create() argument
510 ASSERT(!vd || spa_config_held(spa, SCL_STATE_ALL, RW_READER)); in zio_create()
547 zio->io_spa = spa; in zio_create()
589 zio_null(zio_t *pio, spa_t *spa, vdev_t *vd, zio_done_func_t *done, in zio_null() argument
594 zio = zio_create(pio, spa, 0, NULL, NULL, 0, done, private, in zio_null()
602 zio_root(spa_t *spa, zio_done_func_t *done, void *private, enum zio_flag flags) in zio_root() argument
604 return (zio_null(NULL, spa, NULL, done, private, flags)); in zio_root()
608 zfs_blkptr_verify(spa_t *spa, const blkptr_t *bp) in zfs_blkptr_verify() argument
650 if (vdevid >= spa->spa_root_vdev->vdev_children) { in zfs_blkptr_verify()
656 vdev_t *vd = spa->spa_root_vdev->vdev_child[vdevid]; in zfs_blkptr_verify()
[all …]
H A Ddsl_scan.c93 spa_t *spa = dp->dp_spa; in dsl_scan_init() local
152 spa_scan_stat_init(spa); in dsl_scan_init()
184 spa_t *spa = dp->dp_spa; in dsl_scan_setup_sync() local
196 scn->scn_phys.scn_to_examine = spa->spa_root_vdev->vdev_stat.vs_alloc; in dsl_scan_setup_sync()
199 spa_scan_stat_init(spa); in dsl_scan_setup_sync()
205 vdev_config_dirty(spa->spa_root_vdev); in dsl_scan_setup_sync()
207 if (vdev_resilver_needed(spa->spa_root_vdev, in dsl_scan_setup_sync()
209 spa_event_notify(spa, NULL, ESC_ZFS_RESILVER_START); in dsl_scan_setup_sync()
211 spa_event_notify(spa, NULL, ESC_ZFS_SCRUB_START); in dsl_scan_setup_sync()
214 spa->spa_scrub_started = B_TRUE; in dsl_scan_setup_sync()
[all …]
H A Dzfs_ioctl.c247 static int zfs_prop_activate_feature(spa_t *spa, spa_feature_t feature);
334 spa_t *spa; in zfs_earlier_version() local
336 if (spa_open(name, &spa, FTAG) == 0) { in zfs_earlier_version()
337 if (spa_version(spa) < version) { in zfs_earlier_version()
338 spa_close(spa, FTAG); in zfs_earlier_version()
341 spa_close(spa, FTAG); in zfs_earlier_version()
373 spa_t *spa; in zfs_log_history() local
379 if (spa_open(zc->zc_name, &spa, FTAG) == 0) { in zfs_log_history()
380 if (spa_version(spa) >= SPA_VERSION_ZPOOL_HISTORY) in zfs_log_history()
381 (void) spa_history_log(spa, buf); in zfs_log_history()
[all …]
H A Dmetaslab.c189 metaslab_class_create(spa_t *spa, metaslab_ops_t *ops) in metaslab_class_create() argument
195 mc->mc_spa = spa; in metaslab_class_create()
752 spa_t *spa = vd->vdev_spa; in metaslab_group_allocatable() local
769 mc != spa_normal_class(spa) || mc->mc_alloc_groups == 0); in metaslab_group_allocatable()
1370 spa_t *spa = msp->ms_group->mg_vd->vdev_spa; in metaslab_fragmentation() local
1373 boolean_t feature_enabled = spa_feature_is_enabled(spa, in metaslab_fragmentation()
1391 uint64_t txg = spa_syncing_txg(spa); in metaslab_fragmentation()
1394 if (spa_writeable(spa)) { in metaslab_fragmentation()
1397 spa_dbgmsg(spa, "txg %llu, requesting force condense: " in metaslab_fragmentation()
1547 spa_t *spa = msp->ms_group->mg_vd->vdev_spa; in metaslab_preload() local
[all …]
H A Dspace_map.c241 spa_t *spa = dmu_objset_spa(os); in space_map_write() local
278 SM_DEBUG_SYNCPASS_ENCODE(spa_sync_pass(spa)) | in space_map_write()
402 spa_t *spa = dmu_objset_spa(os); in space_map_truncate() local
418 if ((spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM) && in space_map_truncate()
423 spa_name(spa), doi.doi_bonus_size, doi.doi_data_block_size); in space_map_truncate()
465 spa_t *spa = dmu_objset_spa(os); in space_map_alloc() local
469 if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { in space_map_alloc()
470 spa_feature_incr(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM, tx); in space_map_alloc()
487 spa_t *spa; in space_map_free() local
492 spa = dmu_objset_spa(sm->sm_os); in space_map_free()
[all …]
/titanic_41/usr/src/uts/common/fs/zfs/sys/
H A Dspa.h46 typedef struct spa spa_t;
614 extern void spa_async_request(spa_t *spa, int flag);
615 extern void spa_async_unrequest(spa_t *spa, int flag);
616 extern void spa_async_suspend(spa_t *spa);
617 extern void spa_async_resume(spa_t *spa);
619 extern void spa_inject_delref(spa_t *spa);
620 extern void spa_scan_stat_init(spa_t *spa);
621 extern int spa_scan_get_stats(spa_t *spa, pool_scan_stat_t *ps);
640 extern int spa_vdev_add(spa_t *spa, nvlist_t *nvroot);
641 extern int spa_vdev_attach(spa_t *spa, uint64_t guid, nvlist_t *nvroot,
[all …]
H A Dzfeature.h41 struct spa;
45 extern void spa_feature_create_zap_objects(struct spa *, struct dmu_tx *);
46 extern void spa_feature_enable(struct spa *, spa_feature_t,
48 extern void spa_feature_incr(struct spa *, spa_feature_t, struct dmu_tx *);
49 extern void spa_feature_decr(struct spa *, spa_feature_t, struct dmu_tx *);
50 extern boolean_t spa_feature_is_enabled(struct spa *, spa_feature_t);
51 extern boolean_t spa_feature_is_active(struct spa *, spa_feature_t);
52 extern boolean_t spa_feature_enabled_txg(spa_t *spa, spa_feature_t fid,
61 extern int feature_get_refcount(struct spa *, zfeature_info_t *, uint64_t *);
62 extern int feature_get_refcount_from_disk(spa_t *spa, zfeature_info_t *feature,
[all …]
H A Dddt.h202 extern void ddt_get_dedup_object_stats(spa_t *spa, ddt_object_t *ddo);
203 extern void ddt_get_dedup_histogram(spa_t *spa, ddt_histogram_t *ddh);
204 extern void ddt_get_dedup_stats(spa_t *spa, ddt_stat_t *dds_total);
206 extern uint64_t ddt_get_dedup_dspace(spa_t *spa);
207 extern uint64_t ddt_get_pool_dedup_ratio(spa_t *spa);
216 extern ddt_t *ddt_select(spa_t *spa, const blkptr_t *bp);
220 extern void ddt_prefetch(spa_t *spa, const blkptr_t *bp);
223 extern boolean_t ddt_class_contains(spa_t *spa, enum ddt_class max_class,
231 extern void ddt_create(spa_t *spa);
232 extern int ddt_load(spa_t *spa);
[all …]
H A Darc.h119 arc_buf_t *arc_buf_alloc(spa_t *spa, int size, void *tag,
121 arc_buf_t *arc_loan_buf(spa_t *spa, int size);
136 int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp,
139 zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg,
144 void arc_freed(spa_t *spa, const blkptr_t *bp);
149 void arc_flush(spa_t *spa, boolean_t retry);
160 void l2arc_add_vdev(spa_t *spa, vdev_t *vd, boolean_t rebuild);
167 void l2arc_spa_rebuild_start(spa_t *spa);
H A Dzio.h462 extern zio_t *zio_null(zio_t *pio, spa_t *spa, vdev_t *vd,
465 extern zio_t *zio_root(spa_t *spa,
468 extern zio_t *zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, void *data,
472 extern zio_t *zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp,
478 extern zio_t *zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp,
485 extern void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp);
487 extern zio_t *zio_claim(zio_t *pio, spa_t *spa, uint64_t txg,
491 extern zio_t *zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd,
504 extern zio_t *zio_free_sync(zio_t *pio, spa_t *spa, uint64_t txg,
507 extern int zio_alloc_zil(spa_t *spa, uint64_t txg, blkptr_t *new_bp,
[all …]
H A Dvdev.h61 extern vdev_t *vdev_lookup_top(spa_t *spa, uint64_t vdev);
63 extern int vdev_count_leaves(spa_t *spa);
99 extern int vdev_fault(spa_t *spa, uint64_t guid, vdev_aux_t aux);
100 extern int vdev_degrade(spa_t *spa, uint64_t guid, vdev_aux_t aux);
101 extern int vdev_online(spa_t *spa, uint64_t guid, uint64_t flags,
103 extern int vdev_offline(spa_t *spa, uint64_t guid, uint64_t flags);
104 extern void vdev_clear(spa_t *spa, vdev_t *vd);
137 extern void vdev_top_config_generate(spa_t *spa, nvlist_t *config);
138 extern nvlist_t *vdev_config_generate(spa_t *spa, vdev_t *vd,
/titanic_41/usr/src/cmd/zhack/
H A Dzhack.c87 fatal(spa_t *spa, void *tag, const char *fmt, ...) in fatal() argument
91 if (spa != NULL) { in fatal()
92 spa_close(spa, tag); in fatal()
130 spa_t *spa; in import_pool() local
148 if (readonly && spa_open(target, &spa, FTAG) == 0) { in import_pool()
149 spa_close(spa, FTAG); in import_pool()
165 spa_open(target, &spa, FTAG) == 0) { in import_pool()
166 fatal(spa, FTAG, "cannot import '%s': pool is " in import_pool()
199 zhack_spa_open(const char *target, boolean_t readonly, void *tag, spa_t **spa) in zhack_spa_open() argument
206 err = spa_open(target, spa, tag); in zhack_spa_open()
[all …]
/titanic_41/usr/src/cmd/ztest/
H A Dztest.c993 ztest_random_vdev_top(spa_t *spa, boolean_t log_ok) in ztest_random_vdev_top() argument
996 vdev_t *rvd = spa->spa_root_vdev; in ztest_random_vdev_top()
999 ASSERT(spa_config_held(spa, SCL_ALL, RW_READER) != 0); in ztest_random_vdev_top()
1055 spa_t *spa = ztest_spa; in ztest_spa_prop_set_uint64() local
1062 error = spa_prop_set(spa, props); in ztest_spa_prop_set_uint64()
2346 spa_t *spa; in ztest_spa_create_destroy() local
2373 VERIFY3U(0, ==, spa_open(zo->zo_pool, &spa, FTAG)); in ztest_spa_create_destroy()
2375 spa_close(spa, FTAG); in ztest_spa_create_destroy()
2384 spa_t *spa; in ztest_spa_upgrade() local
2433 VERIFY0(spa_open(name, &spa, FTAG)); in ztest_spa_upgrade()
[all …]
/titanic_41/usr/src/cmd/zdb/
H A Dzdb.c646 verify_spacemap_refcounts(spa_t *spa) in verify_spacemap_refcounts() argument
651 (void) feature_get_refcount(spa, in verify_spacemap_refcounts()
654 actual_refcount = get_dtl_refcount(spa->spa_root_vdev); in verify_spacemap_refcounts()
655 actual_refcount += get_metaslab_refcount(spa->spa_root_vdev); in verify_spacemap_refcounts()
739 spa_t *spa = vd->vdev_spa; in dump_metaslab() local
763 spa_feature_is_active(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { in dump_metaslab()
778 dump_spacemap(spa->spa_meta_objset, msp->ms_sm); in dump_metaslab()
796 dump_metaslab_groups(spa_t *spa) in dump_metaslab_groups() argument
798 vdev_t *rvd = spa->spa_root_vdev; in dump_metaslab_groups()
799 metaslab_class_t *mc = spa_normal_class(spa); in dump_metaslab_groups()
[all …]

123