FreeBSD ZFS
The Zettabyte File System
Functions | Variables

dsl_pool.c File Reference

#include <sys/dsl_pool.h>
#include <sys/dsl_dataset.h>
#include <sys/dsl_prop.h>
#include <sys/dsl_dir.h>
#include <sys/dsl_synctask.h>
#include <sys/dsl_scan.h>
#include <sys/dnode.h>
#include <sys/dmu_tx.h>
#include <sys/dmu_objset.h>
#include <sys/arc.h>
#include <sys/zap.h>
#include <sys/zio.h>
#include <sys/zfs_context.h>
#include <sys/fs/zfs.h>
#include <sys/zfs_znode.h>
#include <sys/spa_impl.h>
#include <sys/dsl_deadlist.h>
#include <sys/bptree.h>
#include <sys/zfeature.h>
#include <sys/zil_impl.h>
Include dependency graph for dsl_pool.c:

Go to the source code of this file.

Functions

 SYSCTL_DECL (_vfs_zfs)
 TUNABLE_INT ("vfs.zfs.no_write_throttle",&zfs_no_write_throttle)
 SYSCTL_INT (_vfs_zfs, OID_AUTO, no_write_throttle, CTLFLAG_RDTUN,&zfs_no_write_throttle, 0,"")
 TUNABLE_INT ("vfs.zfs.write_limit_shift",&zfs_write_limit_shift)
 SYSCTL_INT (_vfs_zfs, OID_AUTO, write_limit_shift, CTLFLAG_RDTUN,&zfs_write_limit_shift, 0,"2^N of physical memory")
 SYSCTL_DECL (_vfs_zfs_txg)
 TUNABLE_INT ("vfs.zfs.txg.synctime_ms",&zfs_txg_synctime_ms)
 SYSCTL_INT (_vfs_zfs_txg, OID_AUTO, synctime_ms, CTLFLAG_RDTUN,&zfs_txg_synctime_ms, 0,"Target milliseconds to sync a txg")
 TUNABLE_QUAD ("vfs.zfs.write_limit_min",&zfs_write_limit_min)
 SYSCTL_UQUAD (_vfs_zfs, OID_AUTO, write_limit_min, CTLFLAG_RDTUN,&zfs_write_limit_min, 0,"Minimum write limit")
 TUNABLE_QUAD ("vfs.zfs.write_limit_max",&zfs_write_limit_max)
 SYSCTL_UQUAD (_vfs_zfs, OID_AUTO, write_limit_max, CTLFLAG_RDTUN,&zfs_write_limit_max, 0,"Maximum data payload per txg")
 TUNABLE_QUAD ("vfs.zfs.write_limit_inflated",&zfs_write_limit_inflated)
 SYSCTL_UQUAD (_vfs_zfs, OID_AUTO, write_limit_inflated, CTLFLAG_RDTUN,&zfs_write_limit_inflated, 0,"")
 TUNABLE_QUAD ("vfs.zfs.write_limit_override",&zfs_write_limit_override)
 SYSCTL_UQUAD (_vfs_zfs, OID_AUTO, write_limit_override, CTLFLAG_RDTUN,&zfs_write_limit_override, 0,"")
int dsl_pool_open_special_dir (dsl_pool_t *dp, const char *name, dsl_dir_t **ddp)
static dsl_pool_tdsl_pool_open_impl (spa_t *spa, uint64_t txg)
int dsl_pool_init (spa_t *spa, uint64_t txg, dsl_pool_t **dpp)
int dsl_pool_open (dsl_pool_t *dp)
void dsl_pool_close (dsl_pool_t *dp)
dsl_pool_tdsl_pool_create (spa_t *spa, nvlist_t *zplprops, uint64_t txg)
void dsl_pool_mos_diduse_space (dsl_pool_t *dp, int64_t used, int64_t comp, int64_t uncomp)
 Account for the meta-objset space in its placeholder dsl_dir.
static int deadlist_enqueue_cb (void *arg, const blkptr_t *bp, dmu_tx_t *tx)
void dsl_pool_sync (dsl_pool_t *dp, uint64_t txg)
void dsl_pool_sync_done (dsl_pool_t *dp, uint64_t txg)
int dsl_pool_sync_context (dsl_pool_t *dp)
 TRUE if the current thread is the tx_sync_thread or if we are being called from SPA context during pool initialization.
uint64_t dsl_pool_adjustedsize (dsl_pool_t *dp, boolean_t netfree)
int dsl_pool_tempreserve_space (dsl_pool_t *dp, uint64_t space, dmu_tx_t *tx)
void dsl_pool_tempreserve_clear (dsl_pool_t *dp, int64_t space, dmu_tx_t *tx)
void dsl_pool_memory_pressure (dsl_pool_t *dp)
void dsl_pool_willuse_space (dsl_pool_t *dp, int64_t space, dmu_tx_t *tx)
static int upgrade_clones_cb (spa_t *spa, uint64_t dsobj, const char *dsname, void *arg)
void dsl_pool_upgrade_clones (dsl_pool_t *dp, dmu_tx_t *tx)
static int upgrade_dir_clones_cb (spa_t *spa, uint64_t dsobj, const char *dsname, void *arg)
void dsl_pool_upgrade_dir_clones (dsl_pool_t *dp, dmu_tx_t *tx)
void dsl_pool_create_origin (dsl_pool_t *dp, dmu_tx_t *tx)
taskq_t * dsl_pool_vnrele_taskq (dsl_pool_t *dp)
void dsl_pool_clean_tmp_userrefs (dsl_pool_t *dp)
 Walk through the pool-wide zap object of temporary snapshot user holds and release them.
void dsl_pool_user_hold_create_obj (dsl_pool_t *dp, dmu_tx_t *tx)
 Create the pool-wide zap object for storing temporary snapshot holds.
static int dsl_pool_user_hold_rele_impl (dsl_pool_t *dp, uint64_t dsobj, const char *tag, uint64_t *now, dmu_tx_t *tx, boolean_t holding)
int dsl_pool_user_hold (dsl_pool_t *dp, uint64_t dsobj, const char *tag, uint64_t *now, dmu_tx_t *tx)
 Add a temporary hold for the given dataset object and tag.
int dsl_pool_user_release (dsl_pool_t *dp, uint64_t dsobj, const char *tag, dmu_tx_t *tx)
 Release a temporary hold for the given dataset object and tag.

Variables

int zfs_no_write_throttle = 0
int zfs_write_limit_shift = 3
 1/8th of physical memory
int zfs_txg_synctime_ms = 1000
 target millisecs to sync a txg
uint64_t zfs_write_limit_min = 32 << 20
 min write limit is 32MB
uint64_t zfs_write_limit_max = 0
 max data payload per txg
uint64_t zfs_write_limit_inflated = 0
uint64_t zfs_write_limit_override = 0
kmutex_t zfs_write_limit_lock
static pgcnt_t old_physmem = 0

Function Documentation

static int deadlist_enqueue_cb ( void *  arg,
const blkptr_t bp,
dmu_tx_t tx 
) [static]

Definition at line 361 of file dsl_pool.c.

uint64_t dsl_pool_adjustedsize ( dsl_pool_t dp,
boolean_t  netfree 
)

Definition at line 586 of file dsl_pool.c.

void dsl_pool_clean_tmp_userrefs ( dsl_pool_t dp)

Walk through the pool-wide zap object of temporary snapshot user holds and release them.

Definition at line 863 of file dsl_pool.c.

void dsl_pool_close ( dsl_pool_t dp)

Definition at line 238 of file dsl_pool.c.

dsl_pool_t* dsl_pool_create ( spa_t spa,
nvlist_t *  zplprops,
uint64_t  txg 
)

Definition at line 279 of file dsl_pool.c.

void dsl_pool_create_origin ( dsl_pool_t dp,
dmu_tx_t tx 
)

Definition at line 832 of file dsl_pool.c.

int dsl_pool_init ( spa_t spa,
uint64_t  txg,
dsl_pool_t **  dpp 
)

Definition at line 134 of file dsl_pool.c.

void dsl_pool_memory_pressure ( dsl_pool_t dp)

Definition at line 658 of file dsl_pool.c.

void dsl_pool_mos_diduse_space ( dsl_pool_t dp,
int64_t  used,
int64_t  comp,
int64_t  uncomp 
)

Account for the meta-objset space in its placeholder dsl_dir.

Definition at line 349 of file dsl_pool.c.

int dsl_pool_open ( dsl_pool_t dp)

Definition at line 150 of file dsl_pool.c.

static dsl_pool_t* dsl_pool_open_impl ( spa_t spa,
uint64_t  txg 
) [static]

Definition at line 104 of file dsl_pool.c.

int dsl_pool_open_special_dir ( dsl_pool_t dp,
const char *  name,
dsl_dir_t **  ddp 
)

Definition at line 89 of file dsl_pool.c.

void dsl_pool_sync ( dsl_pool_t dp,
uint64_t  txg 
)

Definition at line 372 of file dsl_pool.c.

int dsl_pool_sync_context ( dsl_pool_t dp)

TRUE if the current thread is the tx_sync_thread or if we are being called from SPA context during pool initialization.

Definition at line 579 of file dsl_pool.c.

void dsl_pool_sync_done ( dsl_pool_t dp,
uint64_t  txg 
)

Definition at line 560 of file dsl_pool.c.

void dsl_pool_tempreserve_clear ( dsl_pool_t dp,
int64_t  space,
dmu_tx_t tx 
)

Definition at line 651 of file dsl_pool.c.

int dsl_pool_tempreserve_space ( dsl_pool_t dp,
uint64_t  space,
dmu_tx_t tx 
)

Definition at line 609 of file dsl_pool.c.

void dsl_pool_upgrade_clones ( dsl_pool_t dp,
dmu_tx_t tx 
)

Definition at line 763 of file dsl_pool.c.

void dsl_pool_upgrade_dir_clones ( dsl_pool_t dp,
dmu_tx_t tx 
)

Definition at line 806 of file dsl_pool.c.

int dsl_pool_user_hold ( dsl_pool_t dp,
uint64_t  dsobj,
const char *  tag,
uint64_t *  now,
dmu_tx_t tx 
)

Add a temporary hold for the given dataset object and tag.

Definition at line 943 of file dsl_pool.c.

void dsl_pool_user_hold_create_obj ( dsl_pool_t dp,
dmu_tx_t tx 
)

Create the pool-wide zap object for storing temporary snapshot holds.

Definition at line 893 of file dsl_pool.c.

static int dsl_pool_user_hold_rele_impl ( dsl_pool_t dp,
uint64_t  dsobj,
const char *  tag,
uint64_t *  now,
dmu_tx_t tx,
boolean_t  holding 
) [static]

Definition at line 905 of file dsl_pool.c.

int dsl_pool_user_release ( dsl_pool_t dp,
uint64_t  dsobj,
const char *  tag,
dmu_tx_t tx 
)

Release a temporary hold for the given dataset object and tag.

Definition at line 953 of file dsl_pool.c.

taskq_t* dsl_pool_vnrele_taskq ( dsl_pool_t dp)

Definition at line 853 of file dsl_pool.c.

void dsl_pool_willuse_space ( dsl_pool_t dp,
int64_t  space,
dmu_tx_t tx 
)

Definition at line 675 of file dsl_pool.c.

SYSCTL_DECL ( _vfs_zfs  )
SYSCTL_DECL ( _vfs_zfs_txg  )
SYSCTL_INT ( _vfs_zfs_txg  ,
OID_AUTO  ,
synctime_ms  ,
CTLFLAG_RDTUN  ,
zfs_txg_synctime_ms,
,
"Target milliseconds to sync a txg"   
)
SYSCTL_INT ( _vfs_zfs  ,
OID_AUTO  ,
no_write_throttle  ,
CTLFLAG_RDTUN  ,
zfs_no_write_throttle,
,
""   
)
SYSCTL_INT ( _vfs_zfs  ,
OID_AUTO  ,
write_limit_shift  ,
CTLFLAG_RDTUN  ,
zfs_write_limit_shift,
,
"2^N of physical memory"   
)
SYSCTL_UQUAD ( _vfs_zfs  ,
OID_AUTO  ,
write_limit_max  ,
CTLFLAG_RDTUN  ,
zfs_write_limit_max,
,
"Maximum data payload per txg"   
)
SYSCTL_UQUAD ( _vfs_zfs  ,
OID_AUTO  ,
write_limit_override  ,
CTLFLAG_RDTUN  ,
zfs_write_limit_override,
,
""   
)
SYSCTL_UQUAD ( _vfs_zfs  ,
OID_AUTO  ,
write_limit_min  ,
CTLFLAG_RDTUN  ,
zfs_write_limit_min,
,
"Minimum write limit"   
)
SYSCTL_UQUAD ( _vfs_zfs  ,
OID_AUTO  ,
write_limit_inflated  ,
CTLFLAG_RDTUN  ,
zfs_write_limit_inflated,
,
""   
)
TUNABLE_INT ( "vfs.zfs.txg.synctime_ms"  ,
zfs_txg_synctime_ms 
)
TUNABLE_INT ( "vfs.zfs.no_write_throttle"  ,
zfs_no_write_throttle 
)
TUNABLE_INT ( "vfs.zfs.write_limit_shift"  ,
zfs_write_limit_shift 
)
TUNABLE_QUAD ( "vfs.zfs.write_limit_min"  ,
zfs_write_limit_min 
)
TUNABLE_QUAD ( "vfs.zfs.write_limit_override"  ,
zfs_write_limit_override 
)
TUNABLE_QUAD ( "vfs.zfs.write_limit_inflated"  ,
zfs_write_limit_inflated 
)
TUNABLE_QUAD ( "vfs.zfs.write_limit_max"  ,
zfs_write_limit_max 
)
static int upgrade_clones_cb ( spa_t spa,
uint64_t  dsobj,
const char *  dsname,
void *  arg 
) [static]

Definition at line 686 of file dsl_pool.c.

static int upgrade_dir_clones_cb ( spa_t spa,
uint64_t  dsobj,
const char *  dsname,
void *  arg 
) [static]

Definition at line 774 of file dsl_pool.c.


Variable Documentation

pgcnt_t old_physmem = 0 [static]

Definition at line 61 of file dsl_pool.c.

Definition at line 59 of file dsl_pool.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines