FreeBSD ZFS
The Zettabyte File System
|
SPA locking. More...
#include <sys/zfs_context.h>
#include <sys/spa_impl.h>
#include <sys/zio.h>
#include <sys/zio_checksum.h>
#include <sys/zio_compress.h>
#include <sys/dmu.h>
#include <sys/dmu_tx.h>
#include <sys/zap.h>
#include <sys/zil.h>
#include <sys/vdev_impl.h>
#include <sys/metaslab.h>
#include <sys/uberblock_impl.h>
#include <sys/txg.h>
#include <sys/avl.h>
#include <sys/unique.h>
#include <sys/dsl_pool.h>
#include <sys/dsl_dir.h>
#include <sys/dsl_prop.h>
#include <sys/dsl_scan.h>
#include <sys/fs/zfs.h>
#include <sys/metaslab_impl.h>
#include <sys/arc.h>
#include <sys/ddt.h>
#include "zfs_prop.h"
#include "zfeature_common.h"
Go to the source code of this file.
Data Structures | |
struct | spa_aux |
Typedefs | |
typedef struct spa_aux | spa_aux_t |
Functions | |
SYSCTL_DECL (_vfs_zfs) | |
TUNABLE_INT ("vfs.zfs.recover",&zfs_recover) | |
SYSCTL_INT (_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN,&zfs_recover, 0,"Try to recover from otherwise-fatal errors.") | |
static void | spa_config_lock_init (spa_t *spa) |
static void | spa_config_lock_destroy (spa_t *spa) |
int | spa_config_tryenter (spa_t *spa, int locks, void *tag, krw_t rw) |
void | spa_config_enter (spa_t *spa, int locks, void *tag, krw_t rw) |
void | spa_config_exit (spa_t *spa, int locks, void *tag) |
int | spa_config_held (spa_t *spa, int locks, krw_t rw) |
spa_t * | spa_lookup (const char *name) |
Lookup the named spa_t in the AVL tree. | |
spa_t * | spa_add (const char *name, nvlist_t *config, const char *altroot) |
Create an uninitialized spa_t with the given name. | |
void | spa_remove (spa_t *spa) |
Removes a spa_t from the namespace, freeing up any memory used. | |
spa_t * | spa_next (spa_t *prev) |
Find the next pool. | |
void | spa_open_ref (spa_t *spa, void *tag) |
Add a reference to the given spa_t. | |
void | spa_close (spa_t *spa, void *tag) |
Remove a reference to the given spa_t. | |
boolean_t | spa_refcount_zero (spa_t *spa) |
Check to see if the spa refcount is zero. | |
static int | spa_aux_compare (const void *a, const void *b) |
void | spa_aux_add (vdev_t *vd, avl_tree_t *avl) |
void | spa_aux_remove (vdev_t *vd, avl_tree_t *avl) |
boolean_t | spa_aux_exists (uint64_t guid, uint64_t *pool, int *refcnt, avl_tree_t *avl) |
void | spa_aux_activate (vdev_t *vd, avl_tree_t *avl) |
static int | spa_spare_compare (const void *a, const void *b) |
void | spa_spare_add (vdev_t *vd) |
void | spa_spare_remove (vdev_t *vd) |
boolean_t | spa_spare_exists (uint64_t guid, uint64_t *pool, int *refcnt) |
void | spa_spare_activate (vdev_t *vd) |
static int | spa_l2cache_compare (const void *a, const void *b) |
void | spa_l2cache_add (vdev_t *vd) |
void | spa_l2cache_remove (vdev_t *vd) |
boolean_t | spa_l2cache_exists (uint64_t guid, uint64_t *pool) |
void | spa_l2cache_activate (vdev_t *vd) |
uint64_t | spa_vdev_enter (spa_t *spa) |
Lock the given spa_t for the purpose of adding or removing a vdev. | |
uint64_t | spa_vdev_config_enter (spa_t *spa) |
Internal implementation for spa_vdev_enter(). | |
void | spa_vdev_config_exit (spa_t *spa, vdev_t *vd, uint64_t txg, int error, char *tag) |
Used in combination with spa_vdev_config_enter() to allow the syncing of multiple transactions without releasing the spa_namespace_lock. | |
int | spa_vdev_exit (spa_t *spa, vdev_t *vd, uint64_t txg, int error) |
Unlock the spa_t after adding or removing a vdev. | |
void | spa_vdev_state_enter (spa_t *spa, int oplocks) |
Lock the given spa_t for the purpose of changing vdev state. | |
int | spa_vdev_state_exit (spa_t *spa, vdev_t *vd, int error) |
void | spa_activate_mos_feature (spa_t *spa, const char *feature) |
void | spa_deactivate_mos_feature (spa_t *spa, const char *feature) |
int | spa_rename (const char *name, const char *newname) |
Rename a spa_t. | |
spa_t * | spa_by_guid (uint64_t pool_guid, uint64_t device_guid) |
Return the spa_t associated with given pool_guid, if it exists. | |
boolean_t | spa_guid_exists (uint64_t pool_guid, uint64_t device_guid) |
Determine whether a pool with the given pool_guid exists. | |
char * | spa_strdup (const char *s) |
void | spa_strfree (char *s) |
uint64_t | spa_get_random (uint64_t range) |
uint64_t | spa_generate_guid (spa_t *spa) |
void | sprintf_blkptr (char *buf, const blkptr_t *bp) |
void | spa_freeze (spa_t *spa) |
void | zfs_panic_recover (const char *fmt,...) |
uint64_t | zfs_strtonum (const char *str, char **nptr) |
This is a stripped-down version of strtoull, suitable only for converting lowercase hexadecimal numbers that don't overflow. | |
boolean_t | spa_shutting_down (spa_t *spa) |
dsl_pool_t * | spa_get_dsl (spa_t *spa) |
boolean_t | spa_is_initializing (spa_t *spa) |
blkptr_t * | spa_get_rootblkptr (spa_t *spa) |
void | spa_set_rootblkptr (spa_t *spa, const blkptr_t *bp) |
void | spa_altroot (spa_t *spa, char *buf, size_t buflen) |
int | spa_sync_pass (spa_t *spa) |
char * | spa_name (spa_t *spa) |
uint64_t | spa_guid (spa_t *spa) |
uint64_t | spa_load_guid (spa_t *spa) |
uint64_t | spa_last_synced_txg (spa_t *spa) |
uint64_t | spa_first_txg (spa_t *spa) |
uint64_t | spa_syncing_txg (spa_t *spa) |
pool_state_t | spa_state (spa_t *spa) |
spa_load_state_t | spa_load_state (spa_t *spa) |
uint64_t | spa_freeze_txg (spa_t *spa) |
uint64_t | spa_get_asize (spa_t *spa, uint64_t lsize) |
uint64_t | spa_get_dspace (spa_t *spa) |
void | spa_update_dspace (spa_t *spa) |
uint8_t | spa_get_failmode (spa_t *spa) |
Return the failure mode that has been set to this pool. | |
boolean_t | spa_suspended (spa_t *spa) |
uint64_t | spa_version (spa_t *spa) |
boolean_t | spa_deflate (spa_t *spa) |
metaslab_class_t * | spa_normal_class (spa_t *spa) |
metaslab_class_t * | spa_log_class (spa_t *spa) |
int | spa_max_replication (spa_t *spa) |
int | spa_prev_software_version (spa_t *spa) |
uint64_t | dva_get_dsize_sync (spa_t *spa, const dva_t *dva) |
uint64_t | bp_get_dsize_sync (spa_t *spa, const blkptr_t *bp) |
uint64_t | bp_get_dsize (spa_t *spa, const blkptr_t *bp) |
static int | spa_name_compare (const void *a1, const void *a2) |
int | spa_busy (void) |
void | spa_boot_init () |
void | spa_init (int mode) |
void | spa_fini (void) |
boolean_t | spa_has_slogs (spa_t *spa) |
Return whether this pool has slogs. | |
spa_log_state_t | spa_get_log_state (spa_t *spa) |
void | spa_set_log_state (spa_t *spa, spa_log_state_t state) |
boolean_t | spa_is_root (spa_t *spa) |
boolean_t | spa_writeable (spa_t *spa) |
int | spa_mode (spa_t *spa) |
uint64_t | spa_bootfs (spa_t *spa) |
uint64_t | spa_delegation (spa_t *spa) |
objset_t * | spa_meta_objset (spa_t *spa) |
enum zio_checksum | spa_dedup_checksum (spa_t *spa) |
void | spa_scan_stat_init (spa_t *spa) |
Reset pool scan stat per scan pass (or reboot). | |
int | spa_scan_get_stats (spa_t *spa, pool_scan_stat_t *ps) |
Get scan stats for zpool status reports. | |
boolean_t | spa_debug_enabled (spa_t *spa) |
Variables | |
static avl_tree_t | spa_namespace_avl |
kmutex_t | spa_namespace_lock |
spa namespace global mutex | |
static kcondvar_t | spa_namespace_cv |
static int | spa_active_count |
int | spa_max_replication_override = SPA_DVAS_PER_BP |
static kmutex_t | spa_spare_lock |
static avl_tree_t | spa_spare_avl |
static kmutex_t | spa_l2cache_lock |
static avl_tree_t | spa_l2cache_avl |
kmem_cache_t * | spa_buffer_pool |
int | spa_mode_global |
mode, e.g. | |
int | zfs_flags = 0 |
int | zfs_recover = 0 |
zfs_recover can be set to nonzero to attempt to recover from otherwise-fatal errors, typically caused by on-disk corruption. |
SPA locking.
There are four basic locks for managing spa_t structures:
The locking order is fairly straightforward:
spa_namespace_lock -> spa_refcount
The namespace lock must be acquired to increase the refcount from 0 or to check if it is zero.
spa_refcount -> spa_config_lock[]
There must be at least one valid reference on the spa_t to acquire the config lock.
spa_namespace_lock -> spa_config_lock[]
The namespace lock must always be taken before the config lock.
The spa_namespace_lock can be acquired directly and is globally visible.
The namespace is manipulated using the following functions, all of which require the spa_namespace_lock to be held.
The spa_refcount is manipulated using the following functions:
The spa_config_lock[] is an array of rwlocks, ordered as follows: SCL_CONFIG > SCL_STATE > SCL_ALLOC > SCL_ZIO > SCL_FREE > SCL_VDEV. spa_config_lock[] is manipulated with spa_config_{enter,exit,held}().
To read the configuration, it suffices to hold one of these locks as reader. To modify the configuration, you must hold all locks as writer. To modify vdev state without altering the vdev tree's topology (e.g. online/offline), you must hold SCL_STATE and SCL_ZIO as writer.
We use these distinct config locks to avoid recursive lock entry. For example, spa_sync() (which holds SCL_CONFIG as reader) induces block allocations (SCL_ALLOC), which may require reading space maps from disk (dmu_read() -> zio_read() -> SCL_ZIO).
The spa config locks cannot be normal rwlocks because we need the ability to hand off ownership. For example, SCL_ZIO is acquired by the issuing thread and later released by an interrupt thread. They do, however, obey the usual write-wanted semantics to prevent writer (i.e. system administrator) starvation.
The lock acquisition rules are as follows:
In addition, the following rules apply:
The vdev configuration is protected by spa_vdev_enter() / spa_vdev_exit().
vdev state is protected by spa_vdev_state_enter() / spa_vdev_state_exit(). Like spa_vdev_enter/exit, these are convenience wrappers -- the actual locking is, always, based on spa_namespace_lock and spa_config_lock[].
spa_rename() is also implemented within this file since it requires manipulation of the namespace.
Spares are tracked globally due to the following constraints:
We keep track of all spares on the system through the use of a reference counted AVL tree. When a vdev is added as a spare, or used as a replacement spare, then we bump the reference count in the AVL tree. In addition, we set the 'vdev_isspare' member to indicate that the device is a spare (active or inactive). When a spare is made active (used to replace a device in the pool), we also keep track of which pool its been made a part of.
The 'spa_spare_lock' protects the AVL tree. These functions are normally called under the spa_namespace lock as part of vdev reconfiguration. The separate spare lock exists for the status query path, which does not need to be completely consistent with respect to other vdev configuration changes.
Level 2 ARC devices are tracked globally for the same reasons as spares. Cache devices currently only support one pool per cache device, and so for these devices the aux reference count is currently unused beyond 1.
Definition in file spa_misc.c.
Definition at line 1534 of file spa_misc.c.
Definition at line 1523 of file spa_misc.c.
Definition at line 1507 of file spa_misc.c.
void spa_activate_mos_feature | ( | spa_t * | spa, |
const char * | feature | ||
) |
Definition at line 1046 of file spa_misc.c.
spa_t* spa_add | ( | const char * | name, |
nvlist_t * | config, | ||
const char * | altroot | ||
) |
Create an uninitialized spa_t with the given name.
Requires spa_namespace_lock. The caller must ensure that the spa_t doesn't already exist by calling spa_lookup() first.
Definition at line 414 of file spa_misc.c.
void spa_altroot | ( | spa_t * | spa, |
char * | buf, | ||
size_t | buflen | ||
) |
Definition at line 1325 of file spa_misc.c.
void spa_aux_activate | ( | vdev_t * | vd, |
avl_tree_t * | avl | ||
) |
Definition at line 712 of file spa_misc.c.
void spa_aux_add | ( | vdev_t * | vd, |
avl_tree_t * | avl | ||
) |
Definition at line 649 of file spa_misc.c.
static int spa_aux_compare | ( | const void * | a, |
const void * | b | ||
) | [static] |
Definition at line 635 of file spa_misc.c.
boolean_t spa_aux_exists | ( | uint64_t | guid, |
uint64_t * | pool, | ||
int * | refcnt, | ||
avl_tree_t * | avl | ||
) |
Definition at line 687 of file spa_misc.c.
void spa_aux_remove | ( | vdev_t * | vd, |
avl_tree_t * | avl | ||
) |
Definition at line 667 of file spa_misc.c.
void spa_boot_init | ( | ) |
Definition at line 1576 of file spa_misc.c.
uint64_t spa_bootfs | ( | spa_t * | spa | ) |
Definition at line 1692 of file spa_misc.c.
int spa_busy | ( | void | ) |
Definition at line 1570 of file spa_misc.c.
spa_t* spa_by_guid | ( | uint64_t | pool_guid, |
uint64_t | device_guid | ||
) |
Return the spa_t associated with given pool_guid, if it exists.
If device_guid is non-zero, determine whether the pool exists *and* contains a device with the specified device_guid.
Definition at line 1115 of file spa_misc.c.
void spa_close | ( | spa_t * | spa, |
void * | tag | ||
) |
Remove a reference to the given spa_t.
Must have at least one reference, or have the namespace lock held.
Definition at line 596 of file spa_misc.c.
void spa_config_enter | ( | spa_t * | spa, |
int | locks, | ||
void * | tag, | ||
krw_t | rw | ||
) |
Definition at line 302 of file spa_misc.c.
void spa_config_exit | ( | spa_t * | spa, |
int | locks, | ||
void * | tag | ||
) |
Definition at line 333 of file spa_misc.c.
int spa_config_held | ( | spa_t * | spa, |
int | locks, | ||
krw_t | rw | ||
) |
Definition at line 352 of file spa_misc.c.
static void spa_config_lock_destroy | ( | spa_t * | spa | ) | [static] |
Definition at line 260 of file spa_misc.c.
static void spa_config_lock_init | ( | spa_t * | spa | ) | [static] |
Definition at line 247 of file spa_misc.c.
int spa_config_tryenter | ( | spa_t * | spa, |
int | locks, | ||
void * | tag, | ||
krw_t | rw | ||
) |
Definition at line 273 of file spa_misc.c.
void spa_deactivate_mos_feature | ( | spa_t * | spa, |
const char * | feature | ||
) |
Definition at line 1053 of file spa_misc.c.
boolean_t spa_debug_enabled | ( | spa_t * | spa | ) |
Definition at line 1758 of file spa_misc.c.
enum zio_checksum spa_dedup_checksum | ( | spa_t * | spa | ) |
Definition at line 1710 of file spa_misc.c.
boolean_t spa_deflate | ( | spa_t * | spa | ) |
Definition at line 1470 of file spa_misc.c.
uint64_t spa_delegation | ( | spa_t * | spa | ) |
Definition at line 1698 of file spa_misc.c.
void spa_fini | ( | void | ) |
Definition at line 1627 of file spa_misc.c.
uint64_t spa_first_txg | ( | spa_t * | spa | ) |
Definition at line 1391 of file spa_misc.c.
void spa_freeze | ( | spa_t * | spa | ) |
Definition at line 1233 of file spa_misc.c.
uint64_t spa_freeze_txg | ( | spa_t * | spa | ) |
Definition at line 1415 of file spa_misc.c.
uint64_t spa_generate_guid | ( | spa_t * | spa | ) |
Definition at line 1191 of file spa_misc.c.
uint64_t spa_get_asize | ( | spa_t * | spa, |
uint64_t | lsize | ||
) |
Definition at line 1422 of file spa_misc.c.
dsl_pool_t* spa_get_dsl | ( | spa_t * | spa | ) | [read] |
Definition at line 1301 of file spa_misc.c.
uint64_t spa_get_dspace | ( | spa_t * | spa | ) |
Definition at line 1435 of file spa_misc.c.
uint8_t spa_get_failmode | ( | spa_t * | spa | ) |
Return the failure mode that has been set to this pool.
The default behavior will be to block all I/Os when a complete failure occurs.
Definition at line 1452 of file spa_misc.c.
spa_log_state_t spa_get_log_state | ( | spa_t * | spa | ) |
Definition at line 1662 of file spa_misc.c.
uint64_t spa_get_random | ( | uint64_t | range | ) |
Definition at line 1179 of file spa_misc.c.
Definition at line 1313 of file spa_misc.c.
uint64_t spa_guid | ( | spa_t * | spa | ) |
Definition at line 1346 of file spa_misc.c.
boolean_t spa_guid_exists | ( | uint64_t | pool_guid, |
uint64_t | device_guid | ||
) |
Determine whether a pool with the given pool_guid exists.
Definition at line 1153 of file spa_misc.c.
boolean_t spa_has_slogs | ( | spa_t * | spa | ) |
Return whether this pool has slogs.
No locking needed. It's not a problem if the wrong answer is returned as it's only for performance and not correctness
Definition at line 1656 of file spa_misc.c.
void spa_init | ( | int | mode | ) |
Definition at line 1582 of file spa_misc.c.
boolean_t spa_is_initializing | ( | spa_t * | spa | ) |
Definition at line 1307 of file spa_misc.c.
boolean_t spa_is_root | ( | spa_t * | spa | ) |
Definition at line 1674 of file spa_misc.c.
void spa_l2cache_activate | ( | vdev_t * | vd | ) |
Definition at line 845 of file spa_misc.c.
void spa_l2cache_add | ( | vdev_t * | vd | ) |
Definition at line 813 of file spa_misc.c.
static int spa_l2cache_compare | ( | const void * | a, |
const void * | b | ||
) | [static] |
Definition at line 807 of file spa_misc.c.
boolean_t spa_l2cache_exists | ( | uint64_t | guid, |
uint64_t * | pool | ||
) |
Definition at line 833 of file spa_misc.c.
void spa_l2cache_remove | ( | vdev_t * | vd | ) |
Definition at line 823 of file spa_misc.c.
uint64_t spa_last_synced_txg | ( | spa_t * | spa | ) |
Definition at line 1385 of file spa_misc.c.
uint64_t spa_load_guid | ( | spa_t * | spa | ) |
Definition at line 1374 of file spa_misc.c.
spa_load_state_t spa_load_state | ( | spa_t * | spa | ) |
Definition at line 1409 of file spa_misc.c.
metaslab_class_t* spa_log_class | ( | spa_t * | spa | ) |
Definition at line 1482 of file spa_misc.c.
spa_t* spa_lookup | ( | const char * | name | ) |
Lookup the named spa_t in the AVL tree.
The spa_namespace_lock must be held. Returns NULL if no matching spa_t is found.
Definition at line 379 of file spa_misc.c.
int spa_max_replication | ( | spa_t * | spa | ) |
Definition at line 1488 of file spa_misc.c.
Definition at line 1704 of file spa_misc.c.
int spa_mode | ( | spa_t * | spa | ) |
Definition at line 1686 of file spa_misc.c.
char* spa_name | ( | spa_t * | spa | ) |
Definition at line 1340 of file spa_misc.c.
static int spa_name_compare | ( | const void * | a1, |
const void * | a2 | ||
) | [static] |
Definition at line 1555 of file spa_misc.c.
Find the next pool.
Given a pool, return the next pool in the namespace, or NULL if there is none. If 'prev' is NULL, return the first pool.
Definition at line 563 of file spa_misc.c.
metaslab_class_t* spa_normal_class | ( | spa_t * | spa | ) |
Definition at line 1476 of file spa_misc.c.
void spa_open_ref | ( | spa_t * | spa, |
void * | tag | ||
) |
Add a reference to the given spa_t.
Must have at least one reference, or have the namespace lock held.
Definition at line 584 of file spa_misc.c.
int spa_prev_software_version | ( | spa_t * | spa | ) |
Definition at line 1501 of file spa_misc.c.
boolean_t spa_refcount_zero | ( | spa_t * | spa | ) |
Check to see if the spa refcount is zero.
Must be called with spa_namespace_lock held. We really compare against spa_minref, which is the number of references acquired when opening a pool
Definition at line 609 of file spa_misc.c.
void spa_remove | ( | spa_t * | spa | ) |
Removes a spa_t from the namespace, freeing up any memory used.
Requires spa_namespace_lock. This is called only after the spa_t has been closed and deactivated.
Definition at line 501 of file spa_misc.c.
int spa_rename | ( | const char * | name, |
const char * | newname | ||
) |
Rename a spa_t.
Definition at line 1063 of file spa_misc.c.
int spa_scan_get_stats | ( | spa_t * | spa, |
pool_scan_stat_t * | ps | ||
) |
Get scan stats for zpool status reports.
Definition at line 1731 of file spa_misc.c.
void spa_scan_stat_init | ( | spa_t * | spa | ) |
Reset pool scan stat per scan pass (or reboot).
Definition at line 1719 of file spa_misc.c.
void spa_set_log_state | ( | spa_t * | spa, |
spa_log_state_t | state | ||
) |
Definition at line 1668 of file spa_misc.c.
Definition at line 1319 of file spa_misc.c.
boolean_t spa_shutting_down | ( | spa_t * | spa | ) |
Definition at line 1295 of file spa_misc.c.
void spa_spare_activate | ( | vdev_t * | vd | ) |
Definition at line 789 of file spa_misc.c.
void spa_spare_add | ( | vdev_t * | vd | ) |
Definition at line 757 of file spa_misc.c.
static int spa_spare_compare | ( | const void * | a, |
const void * | b | ||
) | [static] |
Definition at line 751 of file spa_misc.c.
boolean_t spa_spare_exists | ( | uint64_t | guid, |
uint64_t * | pool, | ||
int * | refcnt | ||
) |
Definition at line 777 of file spa_misc.c.
void spa_spare_remove | ( | vdev_t * | vd | ) |
Definition at line 767 of file spa_misc.c.
pool_state_t spa_state | ( | spa_t * | spa | ) |
Definition at line 1403 of file spa_misc.c.
char* spa_strdup | ( | const char * | s | ) |
Definition at line 1159 of file spa_misc.c.
void spa_strfree | ( | char * | s | ) |
Definition at line 1173 of file spa_misc.c.
boolean_t spa_suspended | ( | spa_t * | spa | ) |
Definition at line 1458 of file spa_misc.c.
int spa_sync_pass | ( | spa_t * | spa | ) |
Definition at line 1334 of file spa_misc.c.
uint64_t spa_syncing_txg | ( | spa_t * | spa | ) |
Definition at line 1397 of file spa_misc.c.
void spa_update_dspace | ( | spa_t * | spa | ) |
Definition at line 1441 of file spa_misc.c.
uint64_t spa_vdev_config_enter | ( | spa_t * | spa | ) |
Internal implementation for spa_vdev_enter().
Used when a vdev operation requires multiple syncs (i.e. removing a device) while keeping the spa_namespace_lock held.
Definition at line 879 of file spa_misc.c.
Used in combination with spa_vdev_config_enter() to allow the syncing of multiple transactions without releasing the spa_namespace_lock.
Definition at line 893 of file spa_misc.c.
uint64_t spa_vdev_enter | ( | spa_t * | spa | ) |
Lock the given spa_t for the purpose of adding or removing a vdev.
Grabs the global spa_namespace_lock plus the spa config lock for writing. It returns the next transaction group for the spa_t.
Definition at line 866 of file spa_misc.c.
Unlock the spa_t after adding or removing a vdev.
Besides undoing the locking of spa_vdev_enter(), we also want make sure the transactions have synced to disk, and then update the global configuration cache with the new information.
Definition at line 958 of file spa_misc.c.
void spa_vdev_state_enter | ( | spa_t * | spa, |
int | oplocks | ||
) |
Lock the given spa_t for the purpose of changing vdev state.
Definition at line 971 of file spa_misc.c.
Definition at line 998 of file spa_misc.c.
uint64_t spa_version | ( | spa_t * | spa | ) |
Definition at line 1464 of file spa_misc.c.
boolean_t spa_writeable | ( | spa_t * | spa | ) |
Definition at line 1680 of file spa_misc.c.
void sprintf_blkptr | ( | char * | buf, |
const blkptr_t * | bp | ||
) |
Definition at line 1207 of file spa_misc.c.
SYSCTL_DECL | ( | _vfs_zfs | ) |
SYSCTL_INT | ( | _vfs_zfs | , |
OID_AUTO | , | ||
recover | , | ||
CTLFLAG_RDTUN | , | ||
& | zfs_recover, | ||
0 | , | ||
"Try to recover from otherwise-fatal errors." | |||
) |
TUNABLE_INT | ( | "vfs.zfs.recover" | , |
& | zfs_recover | ||
) |
void zfs_panic_recover | ( | const char * | fmt, |
... | |||
) |
Definition at line 1248 of file spa_misc.c.
uint64_t zfs_strtonum | ( | const char * | str, |
char ** | nptr | ||
) |
This is a stripped-down version of strtoull, suitable only for converting lowercase hexadecimal numbers that don't overflow.
Definition at line 1262 of file spa_misc.c.
int spa_active_count [static] |
Definition at line 209 of file spa_misc.c.
kmem_cache_t* spa_buffer_pool |
Definition at line 217 of file spa_misc.c.
avl_tree_t spa_l2cache_avl [static] |
Definition at line 215 of file spa_misc.c.
kmutex_t spa_l2cache_lock [static] |
Definition at line 214 of file spa_misc.c.
int spa_max_replication_override = SPA_DVAS_PER_BP |
Definition at line 210 of file spa_misc.c.
int spa_mode_global |
avl_tree_t spa_namespace_avl [static] |
Definition at line 206 of file spa_misc.c.
kcondvar_t spa_namespace_cv [static] |
Definition at line 208 of file spa_misc.c.
kmutex_t spa_namespace_lock |
spa namespace global mutex
Definition at line 207 of file spa_misc.c.
avl_tree_t spa_spare_avl [static] |
Definition at line 213 of file spa_misc.c.
kmutex_t spa_spare_lock [static] |
Definition at line 212 of file spa_misc.c.
int zfs_flags = 0 |
Definition at line 224 of file spa_misc.c.