FreeBSD ZFS
The Zettabyte File System
Data Structures | Functions | Variables

bptree.c File Reference

A bptree is a queue of root block pointers from destroyed datasets. More...

#include <sys/arc.h>
#include <sys/bptree.h>
#include <sys/dmu.h>
#include <sys/dmu_objset.h>
#include <sys/dmu_tx.h>
#include <sys/dmu_traverse.h>
#include <sys/dsl_dataset.h>
#include <sys/dsl_dir.h>
#include <sys/dsl_pool.h>
#include <sys/dnode.h>
#include <sys/refcount.h>
#include <sys/spa.h>
Include dependency graph for bptree.c:

Go to the source code of this file.

Data Structures

struct  bptree_args

Functions

uint64_t bptree_alloc (objset_t *os, dmu_tx_t *tx)
int bptree_free (objset_t *os, uint64_t obj, dmu_tx_t *tx)
void bptree_add (objset_t *os, uint64_t obj, blkptr_t *bp, uint64_t birth_txg, uint64_t bytes, uint64_t comp, uint64_t uncomp, dmu_tx_t *tx)
static int bptree_visit_cb (spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
int bptree_iterate (objset_t *os, uint64_t obj, boolean_t free, bptree_itor_t func, void *arg, dmu_tx_t *tx)

Variables

struct bptree_args bptree_args_t

Detailed Description

A bptree is a queue of root block pointers from destroyed datasets.

When a dataset is destroyed its root block pointer is put on the end of the pool's bptree queue so the dataset's blocks can be freed asynchronously by dsl_scan_sync. This allows the delete operation to finish without traversing all the dataset's blocks.

Note:
While bt_begin and bt_end are only ever incremented in this code they are effectively reset to 0 every time the entire bptree is freed because the bptree's object is destroyed and re-created.

Definition in file bptree.c.


Function Documentation

void bptree_add ( objset_t os,
uint64_t  obj,
blkptr_t bp,
uint64_t  birth_txg,
uint64_t  bytes,
uint64_t  comp,
uint64_t  uncomp,
dmu_tx_t tx 
)

Definition at line 108 of file bptree.c.

uint64_t bptree_alloc ( objset_t os,
dmu_tx_t tx 
)

Definition at line 63 of file bptree.c.

int bptree_free ( objset_t os,
uint64_t  obj,
dmu_tx_t tx 
)

Definition at line 91 of file bptree.c.

int bptree_iterate ( objset_t os,
uint64_t  obj,
boolean_t  free,
bptree_itor_t  func,
void *  arg,
dmu_tx_t tx 
)

Definition at line 159 of file bptree.c.

static int bptree_visit_cb ( spa_t spa,
zilog_t zilog,
const blkptr_t bp,
arc_buf_t pbuf,
const zbookmark_t zb,
const dnode_phys_t dnp,
void *  arg 
) [static]

Definition at line 140 of file bptree.c.


Variable Documentation

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines