MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dsl_pool_open_impl

Function dsl_pool_open_impl

freebsd/contrib/openzfs/module/zfs/dsl_pool.c:186–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186static dsl_pool_t *
187dsl_pool_open_impl(spa_t *spa, uint64_t txg)
188{
189 dsl_pool_t *dp;
190 blkptr_t *bp = spa_get_rootblkptr(spa);
191
192 dp = kmem_zalloc(sizeof (dsl_pool_t), KM_SLEEP);
193 dp->dp_spa = spa;
194 dp->dp_meta_rootbp = *bp;
195 rrw_init(&dp->dp_config_rwlock, B_TRUE);
196 txg_init(dp, txg);
197 mmp_init(spa);
198
199 txg_list_create(&dp->dp_dirty_datasets, spa,
200 offsetof(dsl_dataset_t, ds_dirty_link));
201 txg_list_create(&dp->dp_dirty_zilogs, spa,
202 offsetof(zilog_t, zl_dirty_link));
203 txg_list_create(&dp->dp_dirty_dirs, spa,
204 offsetof(dsl_dir_t, dd_dirty_link));
205 txg_list_create(&dp->dp_sync_tasks, spa,
206 offsetof(dsl_sync_task_t, dst_node));
207 txg_list_create(&dp->dp_early_sync_tasks, spa,
208 offsetof(dsl_sync_task_t, dst_node));
209
210 dp->dp_sync_taskq = taskq_create("dp_sync_taskq",
211 zfs_sync_taskq_batch_pct, minclsyspri, 1, INT_MAX,
212 TASKQ_THREADS_CPU_PCT);
213
214 dp->dp_zil_clean_taskq = taskq_create("dp_zil_clean_taskq",
215 zfs_zil_clean_taskq_nthr_pct, minclsyspri,
216 zfs_zil_clean_taskq_minalloc,
217 zfs_zil_clean_taskq_maxalloc,
218 TASKQ_PREPOPULATE | TASKQ_THREADS_CPU_PCT);
219
220 mutex_init(&dp->dp_lock, NULL, MUTEX_DEFAULT, NULL);
221 cv_init(&dp->dp_spaceavail_cv, NULL, CV_DEFAULT, NULL);
222
223 dp->dp_zrele_taskq = taskq_create("z_zrele", 100, defclsyspri,
224 boot_ncpus * 8, INT_MAX, TASKQ_PREPOPULATE | TASKQ_DYNAMIC |
225 TASKQ_THREADS_CPU_PCT);
226 dp->dp_unlinked_drain_taskq = taskq_create("z_unlinked_drain",
227 100, defclsyspri, boot_ncpus, INT_MAX,
228 TASKQ_PREPOPULATE | TASKQ_DYNAMIC | TASKQ_THREADS_CPU_PCT);
229
230 return (dp);
231}
232
233int
234dsl_pool_init(spa_t *spa, uint64_t txg, dsl_pool_t **dpp)

Callers 2

dsl_pool_initFunction · 0.85
dsl_pool_createFunction · 0.85

Calls 8

spa_get_rootblkptrFunction · 0.85
rrw_initFunction · 0.85
txg_initFunction · 0.85
mmp_initFunction · 0.85
txg_list_createFunction · 0.85
taskq_createFunction · 0.50
mutex_initFunction · 0.50
cv_initFunction · 0.50

Tested by

no test coverage detected