Print this page
zpool import speedup


 246 
 247 /*
 248  * The maximum number of bytes that can be accessed as part of one
 249  * operation, including metadata.
 250  */
 251 #define DMU_MAX_ACCESS (10<<20) /* 10MB */
 252 #define DMU_MAX_DELETEBLKCNT (20480) /* ~5MB of indirect blocks */
 253 
 254 #define DMU_USERUSED_OBJECT     (-1ULL)
 255 #define DMU_GROUPUSED_OBJECT    (-2ULL)
 256 
 257 /*
 258  * artificial blkids for bonus buffer and spill blocks
 259  */
 260 #define DMU_BONUS_BLKID         (-1ULL)
 261 #define DMU_SPILL_BLKID         (-2ULL)
 262 /*
 263  * Public routines to create, destroy, open, and close objsets.
 264  */
 265 int dmu_objset_hold(const char *name, void *tag, objset_t **osp);

 266 int dmu_objset_own(const char *name, dmu_objset_type_t type,
 267     boolean_t readonly, void *tag, objset_t **osp);
 268 void dmu_objset_rele(objset_t *os, void *tag);
 269 void dmu_objset_disown(objset_t *os, void *tag);
 270 int dmu_objset_open_ds(struct dsl_dataset *ds, objset_t **osp);
 271 
 272 void dmu_objset_evict_dbufs(objset_t *os);
 273 int dmu_objset_create(const char *name, dmu_objset_type_t type, uint64_t flags,
 274     void (*func)(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx), void *arg);
 275 int dmu_objset_clone(const char *name, const char *origin);
 276 int dsl_destroy_snapshots_nvl(struct nvlist *snaps, boolean_t defer,
 277     struct nvlist *errlist);
 278 int dmu_objset_snapshot_one(const char *fsname, const char *snapname);
 279 int dmu_objset_snapshot_tmp(const char *, const char *, int);
 280 int dmu_objset_find(char *name, int func(const char *, void *), void *arg,
 281     int flags);


 282 void dmu_objset_byteswap(void *buf, size_t size);
 283 int dsl_dataset_rename_snapshot(const char *fsname,
 284     const char *oldsnapname, const char *newsnapname, boolean_t recursive);
 285 
 286 typedef struct dmu_buf {
 287         uint64_t db_object;             /* object that this buffer is part of */
 288         uint64_t db_offset;             /* byte offset in this object */
 289         uint64_t db_size;               /* size of buffer in bytes */
 290         void *db_data;                  /* data in buffer */
 291 } dmu_buf_t;
 292 
 293 typedef void dmu_buf_evict_func_t(struct dmu_buf *db, void *user_ptr);
 294 
 295 /*
 296  * The names of zap entries in the DIRECTORY_OBJECT of the MOS.
 297  */
 298 #define DMU_POOL_DIRECTORY_OBJECT       1
 299 #define DMU_POOL_CONFIG                 "config"
 300 #define DMU_POOL_FEATURES_FOR_WRITE     "features_for_write"
 301 #define DMU_POOL_FEATURES_FOR_READ      "features_for_read"




 246 
 247 /*
 248  * The maximum number of bytes that can be accessed as part of one
 249  * operation, including metadata.
 250  */
 251 #define DMU_MAX_ACCESS (10<<20) /* 10MB */
 252 #define DMU_MAX_DELETEBLKCNT (20480) /* ~5MB of indirect blocks */
 253 
 254 #define DMU_USERUSED_OBJECT     (-1ULL)
 255 #define DMU_GROUPUSED_OBJECT    (-2ULL)
 256 
 257 /*
 258  * artificial blkids for bonus buffer and spill blocks
 259  */
 260 #define DMU_BONUS_BLKID         (-1ULL)
 261 #define DMU_SPILL_BLKID         (-2ULL)
 262 /*
 263  * Public routines to create, destroy, open, and close objsets.
 264  */
 265 int dmu_objset_hold(const char *name, void *tag, objset_t **osp);
 266 int dmu_objset_hold_nolock(const char *name, void *tag, objset_t **osp);
 267 int dmu_objset_own(const char *name, dmu_objset_type_t type,
 268     boolean_t readonly, void *tag, objset_t **osp);
 269 void dmu_objset_rele(objset_t *os, void *tag);
 270 void dmu_objset_disown(objset_t *os, void *tag);
 271 int dmu_objset_open_ds(struct dsl_dataset *ds, objset_t **osp);
 272 
 273 void dmu_objset_evict_dbufs(objset_t *os);
 274 int dmu_objset_create(const char *name, dmu_objset_type_t type, uint64_t flags,
 275     void (*func)(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx), void *arg);
 276 int dmu_objset_clone(const char *name, const char *origin);
 277 int dsl_destroy_snapshots_nvl(struct nvlist *snaps, boolean_t defer,
 278     struct nvlist *errlist);
 279 int dmu_objset_snapshot_one(const char *fsname, const char *snapname);
 280 int dmu_objset_snapshot_tmp(const char *, const char *, int);
 281 int dmu_objset_find(char *name, int func(const char *, void *), void *arg,
 282     int flags);
 283 int dmu_objset_find_parallel(char *name, int func(const char *, void *),
 284     void *arg, int flags);
 285 void dmu_objset_byteswap(void *buf, size_t size);
 286 int dsl_dataset_rename_snapshot(const char *fsname,
 287     const char *oldsnapname, const char *newsnapname, boolean_t recursive);
 288 
 289 typedef struct dmu_buf {
 290         uint64_t db_object;             /* object that this buffer is part of */
 291         uint64_t db_offset;             /* byte offset in this object */
 292         uint64_t db_size;               /* size of buffer in bytes */
 293         void *db_data;                  /* data in buffer */
 294 } dmu_buf_t;
 295 
 296 typedef void dmu_buf_evict_func_t(struct dmu_buf *db, void *user_ptr);
 297 
 298 /*
 299  * The names of zap entries in the DIRECTORY_OBJECT of the MOS.
 300  */
 301 #define DMU_POOL_DIRECTORY_OBJECT       1
 302 #define DMU_POOL_CONFIG                 "config"
 303 #define DMU_POOL_FEATURES_FOR_WRITE     "features_for_write"
 304 #define DMU_POOL_FEATURES_FOR_READ      "features_for_read"