mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
module/*.ko: prune .data, global .rodata
Evaluated every variable that lives in .data (and globals in .rodata) in the kernel modules, and constified/eliminated/localised them appropriately. This means that all read-only data is now actually read-only data, and, if possible, at file scope. A lot of previously- global-symbols became inlinable (and inlined!) constants. Probably not in a big Wowee Performance Moment, but hey. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12899
This commit is contained in:
+34
-33
@@ -352,7 +352,7 @@ static list_t arc_evict_waiters;
|
||||
* can still happen, even during the potentially long time that arc_size is
|
||||
* more than arc_c.
|
||||
*/
|
||||
int zfs_arc_eviction_pct = 200;
|
||||
static int zfs_arc_eviction_pct = 200;
|
||||
|
||||
/*
|
||||
* The number of headers to evict in arc_evict_state_impl() before
|
||||
@@ -361,7 +361,7 @@ int zfs_arc_eviction_pct = 200;
|
||||
* oldest header in the arc state), but comes with higher overhead
|
||||
* (i.e. more invocations of arc_evict_state_impl()).
|
||||
*/
|
||||
int zfs_arc_evict_batch_limit = 10;
|
||||
static int zfs_arc_evict_batch_limit = 10;
|
||||
|
||||
/* number of seconds before growing cache again */
|
||||
int arc_grow_retry = 5;
|
||||
@@ -369,13 +369,13 @@ int arc_grow_retry = 5;
|
||||
/*
|
||||
* Minimum time between calls to arc_kmem_reap_soon().
|
||||
*/
|
||||
int arc_kmem_cache_reap_retry_ms = 1000;
|
||||
static const int arc_kmem_cache_reap_retry_ms = 1000;
|
||||
|
||||
/* shift of arc_c for calculating overflow limit in arc_get_data_impl */
|
||||
int zfs_arc_overflow_shift = 8;
|
||||
static int zfs_arc_overflow_shift = 8;
|
||||
|
||||
/* shift of arc_c for calculating both min and max arc_p */
|
||||
int arc_p_min_shift = 4;
|
||||
static int arc_p_min_shift = 4;
|
||||
|
||||
/* log2(fraction of arc to reclaim) */
|
||||
int arc_shrink_shift = 7;
|
||||
@@ -421,19 +421,22 @@ unsigned long zfs_arc_max = 0;
|
||||
unsigned long zfs_arc_min = 0;
|
||||
unsigned long zfs_arc_meta_limit = 0;
|
||||
unsigned long zfs_arc_meta_min = 0;
|
||||
unsigned long zfs_arc_dnode_limit = 0;
|
||||
unsigned long zfs_arc_dnode_reduce_percent = 10;
|
||||
int zfs_arc_grow_retry = 0;
|
||||
int zfs_arc_shrink_shift = 0;
|
||||
int zfs_arc_p_min_shift = 0;
|
||||
static unsigned long zfs_arc_dnode_limit = 0;
|
||||
static unsigned long zfs_arc_dnode_reduce_percent = 10;
|
||||
static int zfs_arc_grow_retry = 0;
|
||||
static int zfs_arc_shrink_shift = 0;
|
||||
static int zfs_arc_p_min_shift = 0;
|
||||
int zfs_arc_average_blocksize = 8 * 1024; /* 8KB */
|
||||
|
||||
/*
|
||||
* ARC dirty data constraints for arc_tempreserve_space() throttle.
|
||||
* ARC dirty data constraints for arc_tempreserve_space() throttle:
|
||||
* * total dirty data limit
|
||||
* * anon block dirty limit
|
||||
* * each pool's anon allowance
|
||||
*/
|
||||
unsigned long zfs_arc_dirty_limit_percent = 50; /* total dirty data limit */
|
||||
unsigned long zfs_arc_anon_limit_percent = 25; /* anon block dirty limit */
|
||||
unsigned long zfs_arc_pool_dirty_percent = 20; /* each pool's anon allowance */
|
||||
static const unsigned long zfs_arc_dirty_limit_percent = 50;
|
||||
static const unsigned long zfs_arc_anon_limit_percent = 25;
|
||||
static const unsigned long zfs_arc_pool_dirty_percent = 20;
|
||||
|
||||
/*
|
||||
* Enable or disable compressed arc buffers.
|
||||
@@ -444,24 +447,24 @@ int zfs_compressed_arc_enabled = B_TRUE;
|
||||
* ARC will evict meta buffers that exceed arc_meta_limit. This
|
||||
* tunable make arc_meta_limit adjustable for different workloads.
|
||||
*/
|
||||
unsigned long zfs_arc_meta_limit_percent = 75;
|
||||
static unsigned long zfs_arc_meta_limit_percent = 75;
|
||||
|
||||
/*
|
||||
* Percentage that can be consumed by dnodes of ARC meta buffers.
|
||||
*/
|
||||
unsigned long zfs_arc_dnode_limit_percent = 10;
|
||||
static unsigned long zfs_arc_dnode_limit_percent = 10;
|
||||
|
||||
/*
|
||||
* These tunables are Linux specific
|
||||
* These tunables are Linux-specific
|
||||
*/
|
||||
unsigned long zfs_arc_sys_free = 0;
|
||||
int zfs_arc_min_prefetch_ms = 0;
|
||||
int zfs_arc_min_prescient_prefetch_ms = 0;
|
||||
int zfs_arc_p_dampener_disable = 1;
|
||||
int zfs_arc_meta_prune = 10000;
|
||||
int zfs_arc_meta_strategy = ARC_STRATEGY_META_BALANCED;
|
||||
int zfs_arc_meta_adjust_restarts = 4096;
|
||||
int zfs_arc_lotsfree_percent = 10;
|
||||
static unsigned long zfs_arc_sys_free = 0;
|
||||
static int zfs_arc_min_prefetch_ms = 0;
|
||||
static int zfs_arc_min_prescient_prefetch_ms = 0;
|
||||
static int zfs_arc_p_dampener_disable = 1;
|
||||
static int zfs_arc_meta_prune = 10000;
|
||||
static int zfs_arc_meta_strategy = ARC_STRATEGY_META_BALANCED;
|
||||
static int zfs_arc_meta_adjust_restarts = 4096;
|
||||
static int zfs_arc_lotsfree_percent = 10;
|
||||
|
||||
/*
|
||||
* Number of arc_prune threads
|
||||
@@ -651,7 +654,7 @@ arc_sums_t arc_sums;
|
||||
ARCSTAT(stat) = x; \
|
||||
} while (0)
|
||||
|
||||
kstat_t *arc_ksp;
|
||||
static kstat_t *arc_ksp;
|
||||
|
||||
/*
|
||||
* There are several ARC variables that are critical to export as kstats --
|
||||
@@ -785,7 +788,7 @@ unsigned long l2arc_feed_min_ms = L2ARC_FEED_MIN_MS; /* min interval msecs */
|
||||
int l2arc_noprefetch = B_TRUE; /* don't cache prefetch bufs */
|
||||
int l2arc_feed_again = B_TRUE; /* turbo warmup */
|
||||
int l2arc_norw = B_FALSE; /* no reads during writes */
|
||||
int l2arc_meta_percent = 33; /* limit on headers size */
|
||||
static int l2arc_meta_percent = 33; /* limit on headers size */
|
||||
|
||||
/*
|
||||
* L2ARC Internals
|
||||
@@ -886,7 +889,7 @@ int l2arc_exclude_special = 0;
|
||||
* l2arc_mfuonly : A ZFS module parameter that controls whether only MFU
|
||||
* metadata and data are cached from ARC into L2ARC.
|
||||
*/
|
||||
int l2arc_mfuonly = 0;
|
||||
static int l2arc_mfuonly = 0;
|
||||
|
||||
/*
|
||||
* L2ARC TRIM
|
||||
@@ -903,7 +906,7 @@ int l2arc_mfuonly = 0;
|
||||
* will vary depending of how well the specific device handles
|
||||
* these commands.
|
||||
*/
|
||||
unsigned long l2arc_trim_ahead = 0;
|
||||
static unsigned long l2arc_trim_ahead = 0;
|
||||
|
||||
/*
|
||||
* Performance tuning of L2ARC persistence:
|
||||
@@ -918,8 +921,8 @@ unsigned long l2arc_trim_ahead = 0;
|
||||
* data. In this case do not write log blocks in L2ARC in order
|
||||
* not to waste space.
|
||||
*/
|
||||
int l2arc_rebuild_enabled = B_TRUE;
|
||||
unsigned long l2arc_rebuild_blocks_min_l2size = 1024 * 1024 * 1024;
|
||||
static int l2arc_rebuild_enabled = B_TRUE;
|
||||
static unsigned long l2arc_rebuild_blocks_min_l2size = 1024 * 1024 * 1024;
|
||||
|
||||
/* L2ARC persistence rebuild control routines. */
|
||||
void l2arc_rebuild_vdev(vdev_t *vd, boolean_t reopen);
|
||||
@@ -4810,8 +4813,6 @@ arc_kmem_reap_soon(void)
|
||||
size_t i;
|
||||
kmem_cache_t *prev_cache = NULL;
|
||||
kmem_cache_t *prev_data_cache = NULL;
|
||||
extern kmem_cache_t *zio_buf_cache[];
|
||||
extern kmem_cache_t *zio_data_buf_cache[];
|
||||
|
||||
#ifdef _KERNEL
|
||||
if ((aggsum_compare(&arc_sums.arcstat_meta_used,
|
||||
|
||||
+7
-7
@@ -55,7 +55,7 @@
|
||||
#include <sys/wmsum.h>
|
||||
#include <sys/vdev_impl.h>
|
||||
|
||||
kstat_t *dbuf_ksp;
|
||||
static kstat_t *dbuf_ksp;
|
||||
|
||||
typedef struct dbuf_stats {
|
||||
/*
|
||||
@@ -225,12 +225,12 @@ typedef struct dbuf_cache {
|
||||
dbuf_cache_t dbuf_caches[DB_CACHE_MAX];
|
||||
|
||||
/* Size limits for the caches */
|
||||
unsigned long dbuf_cache_max_bytes = ULONG_MAX;
|
||||
unsigned long dbuf_metadata_cache_max_bytes = ULONG_MAX;
|
||||
static unsigned long dbuf_cache_max_bytes = ULONG_MAX;
|
||||
static unsigned long dbuf_metadata_cache_max_bytes = ULONG_MAX;
|
||||
|
||||
/* Set the default sizes of the caches to log2 fraction of arc size */
|
||||
int dbuf_cache_shift = 5;
|
||||
int dbuf_metadata_cache_shift = 6;
|
||||
static int dbuf_cache_shift = 5;
|
||||
static int dbuf_metadata_cache_shift = 6;
|
||||
|
||||
static unsigned long dbuf_cache_target_bytes(void);
|
||||
static unsigned long dbuf_metadata_cache_target_bytes(void);
|
||||
@@ -277,8 +277,8 @@ static unsigned long dbuf_metadata_cache_target_bytes(void);
|
||||
/*
|
||||
* The percentage above and below the maximum cache size.
|
||||
*/
|
||||
uint_t dbuf_cache_hiwater_pct = 10;
|
||||
uint_t dbuf_cache_lowater_pct = 10;
|
||||
static uint_t dbuf_cache_hiwater_pct = 10;
|
||||
static uint_t dbuf_cache_lowater_pct = 10;
|
||||
|
||||
static int
|
||||
dbuf_cons(void *vdb, void *unused, int kmflag)
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
#include <sys/zap.h>
|
||||
#include <sys/dmu_tx.h>
|
||||
|
||||
int ddt_zap_leaf_blockshift = 12;
|
||||
int ddt_zap_indirect_blockshift = 12;
|
||||
static const int ddt_zap_leaf_blockshift = 12;
|
||||
static const int ddt_zap_indirect_blockshift = 12;
|
||||
|
||||
static int
|
||||
ddt_zap_create(objset_t *os, uint64_t *objectp, dmu_tx_t *tx, boolean_t prehash)
|
||||
|
||||
+5
-5
@@ -62,7 +62,7 @@
|
||||
/*
|
||||
* Enable/disable nopwrite feature.
|
||||
*/
|
||||
int zfs_nopwrite_enabled = 1;
|
||||
static int zfs_nopwrite_enabled = 1;
|
||||
|
||||
/*
|
||||
* Tunable to control percentage of dirtied L1 blocks from frees allowed into
|
||||
@@ -70,7 +70,7 @@ int zfs_nopwrite_enabled = 1;
|
||||
* will wait until the next TXG.
|
||||
* A value of zero will disable this throttle.
|
||||
*/
|
||||
unsigned long zfs_per_txg_dirty_frees_percent = 5;
|
||||
static unsigned long zfs_per_txg_dirty_frees_percent = 5;
|
||||
|
||||
/*
|
||||
* Enable/disable forcing txg sync when dirty checking for holes with lseek().
|
||||
@@ -79,14 +79,14 @@ unsigned long zfs_per_txg_dirty_frees_percent = 5;
|
||||
* Disabling this option will result in holes never being reported in dirty
|
||||
* files which is always safe.
|
||||
*/
|
||||
int zfs_dmu_offset_next_sync = 1;
|
||||
static int zfs_dmu_offset_next_sync = 1;
|
||||
|
||||
/*
|
||||
* Limit the amount we can prefetch with one call to this amount. This
|
||||
* helps to limit the amount of memory that can be used by prefetching.
|
||||
* Larger objects should be prefetched a bit at a time.
|
||||
*/
|
||||
int dmu_prefetch_max = 8 * SPA_MAXBLOCKSIZE;
|
||||
static int dmu_prefetch_max = 8 * SPA_MAXBLOCKSIZE;
|
||||
|
||||
const dmu_object_type_info_t dmu_ot[DMU_OT_NUMTYPES] = {
|
||||
{DMU_BSWAP_UINT8, TRUE, FALSE, FALSE, "unallocated" },
|
||||
@@ -1940,7 +1940,7 @@ dmu_object_set_compress(objset_t *os, uint64_t object, uint8_t compress,
|
||||
* When the "redundant_metadata" property is set to "most", only indirect
|
||||
* blocks of this level and higher will have an additional ditto block.
|
||||
*/
|
||||
int zfs_redundant_metadata_most_ditto_level = 2;
|
||||
static const int zfs_redundant_metadata_most_ditto_level = 2;
|
||||
|
||||
void
|
||||
dmu_write_policy(objset_t *os, dnode_t *dn, int level, int wp, zio_prop_t *zp)
|
||||
|
||||
@@ -78,16 +78,16 @@ krwlock_t os_lock;
|
||||
* datasets.
|
||||
* Default is 4 times the number of leaf vdevs.
|
||||
*/
|
||||
int dmu_find_threads = 0;
|
||||
static const int dmu_find_threads = 0;
|
||||
|
||||
/*
|
||||
* Backfill lower metadnode objects after this many have been freed.
|
||||
* Backfilling negatively impacts object creation rates, so only do it
|
||||
* if there are enough holes to fill.
|
||||
*/
|
||||
int dmu_rescan_dnode_threshold = 1 << DN_MAX_INDBLKSHIFT;
|
||||
static const int dmu_rescan_dnode_threshold = 1 << DN_MAX_INDBLKSHIFT;
|
||||
|
||||
static char *upgrade_tag = "upgrade_tag";
|
||||
static const char *upgrade_tag = "upgrade_tag";
|
||||
|
||||
static void dmu_objset_find_dp_cb(void *arg);
|
||||
|
||||
|
||||
@@ -64,12 +64,12 @@
|
||||
#endif
|
||||
#include <sys/zfs_file.h>
|
||||
|
||||
int zfs_recv_queue_length = SPA_MAXBLOCKSIZE;
|
||||
int zfs_recv_queue_ff = 20;
|
||||
int zfs_recv_write_batch_size = 1024 * 1024;
|
||||
static int zfs_recv_queue_length = SPA_MAXBLOCKSIZE;
|
||||
static int zfs_recv_queue_ff = 20;
|
||||
static int zfs_recv_write_batch_size = 1024 * 1024;
|
||||
|
||||
static char *dmu_recv_tag = "dmu_recv_tag";
|
||||
const char *recv_clone_name = "%recv";
|
||||
static void *const dmu_recv_tag = "dmu_recv_tag";
|
||||
const char *const recv_clone_name = "%recv";
|
||||
|
||||
static int receive_read_payload_and_next_header(dmu_recv_cookie_t *ra, int len,
|
||||
void *buf);
|
||||
|
||||
@@ -40,13 +40,14 @@
|
||||
* This controls the number of entries in the buffer the redaction_list_update
|
||||
* synctask uses to buffer writes to the redaction list.
|
||||
*/
|
||||
int redact_sync_bufsize = 1024;
|
||||
static const int redact_sync_bufsize = 1024;
|
||||
|
||||
/*
|
||||
* Controls how often to update the redaction list when creating a redaction
|
||||
* list.
|
||||
*/
|
||||
uint64_t redaction_list_update_interval_ns = 1000 * 1000 * 1000ULL; /* NS */
|
||||
static const uint64_t redaction_list_update_interval_ns =
|
||||
1000 * 1000 * 1000ULL; /* 1s */
|
||||
|
||||
/*
|
||||
* This tunable controls the length of the queues that zfs redact worker threads
|
||||
@@ -56,7 +57,7 @@ uint64_t redaction_list_update_interval_ns = 1000 * 1000 * 1000ULL; /* NS */
|
||||
* available IO resources, or the queues are consuming too much memory, this
|
||||
* variable may need to be decreased.
|
||||
*/
|
||||
int zfs_redact_queue_length = 1024 * 1024;
|
||||
static const int zfs_redact_queue_length = 1024 * 1024;
|
||||
|
||||
/*
|
||||
* These tunables control the fill fraction of the queues by zfs redact. The
|
||||
@@ -65,7 +66,7 @@ int zfs_redact_queue_length = 1024 * 1024;
|
||||
* should be tuned down. If the queues empty before the signalled thread can
|
||||
* catch up, then these should be tuned up.
|
||||
*/
|
||||
uint64_t zfs_redact_queue_ff = 20;
|
||||
static const uint64_t zfs_redact_queue_ff = 20;
|
||||
|
||||
struct redact_record {
|
||||
bqueue_node_t ln;
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
#endif
|
||||
|
||||
/* Set this tunable to TRUE to replace corrupt data with 0x2f5baddb10c */
|
||||
int zfs_send_corrupt_data = B_FALSE;
|
||||
static int zfs_send_corrupt_data = B_FALSE;
|
||||
/*
|
||||
* This tunable controls the amount of data (measured in bytes) that will be
|
||||
* prefetched by zfs send. If the main thread is blocking on reads that haven't
|
||||
@@ -75,7 +75,7 @@ int zfs_send_corrupt_data = B_FALSE;
|
||||
* thread is issuing new reads because the prefetches have fallen out of the
|
||||
* cache, this may need to be decreased.
|
||||
*/
|
||||
int zfs_send_queue_length = SPA_MAXBLOCKSIZE;
|
||||
static int zfs_send_queue_length = SPA_MAXBLOCKSIZE;
|
||||
/*
|
||||
* This tunable controls the length of the queues that zfs send worker threads
|
||||
* use to communicate. If the send_main_thread is blocking on these queues,
|
||||
@@ -83,7 +83,7 @@ int zfs_send_queue_length = SPA_MAXBLOCKSIZE;
|
||||
* at the start of a send as these threads consume all the available IO
|
||||
* resources, this variable may need to be decreased.
|
||||
*/
|
||||
int zfs_send_no_prefetch_queue_length = 1024 * 1024;
|
||||
static int zfs_send_no_prefetch_queue_length = 1024 * 1024;
|
||||
/*
|
||||
* These tunables control the fill fraction of the queues by zfs send. The fill
|
||||
* fraction controls the frequency with which threads have to be cv_signaled.
|
||||
@@ -91,19 +91,19 @@ int zfs_send_no_prefetch_queue_length = 1024 * 1024;
|
||||
* down. If the queues empty before the signalled thread can catch up, then
|
||||
* these should be tuned up.
|
||||
*/
|
||||
int zfs_send_queue_ff = 20;
|
||||
int zfs_send_no_prefetch_queue_ff = 20;
|
||||
static int zfs_send_queue_ff = 20;
|
||||
static int zfs_send_no_prefetch_queue_ff = 20;
|
||||
|
||||
/*
|
||||
* Use this to override the recordsize calculation for fast zfs send estimates.
|
||||
*/
|
||||
int zfs_override_estimate_recordsize = 0;
|
||||
static int zfs_override_estimate_recordsize = 0;
|
||||
|
||||
/* Set this tunable to FALSE to disable setting of DRR_FLAG_FREERECORDS */
|
||||
int zfs_send_set_freerecords_bit = B_TRUE;
|
||||
static const boolean_t zfs_send_set_freerecords_bit = B_TRUE;
|
||||
|
||||
/* Set this tunable to FALSE is disable sending unmodified spill blocks. */
|
||||
int zfs_send_unmodified_spill_blocks = B_TRUE;
|
||||
static int zfs_send_unmodified_spill_blocks = B_TRUE;
|
||||
|
||||
static inline boolean_t
|
||||
overflow_multiply(uint64_t a, uint64_t b, uint64_t *c)
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
#include <sys/callb.h>
|
||||
#include <sys/zfeature.h>
|
||||
|
||||
int32_t zfs_pd_bytes_max = 50 * 1024 * 1024; /* 50MB */
|
||||
int32_t send_holes_without_birth_time = 1;
|
||||
int32_t zfs_traverse_indirect_prefetch_limit = 32;
|
||||
static int32_t zfs_pd_bytes_max = 50 * 1024 * 1024; /* 50MB */
|
||||
static int32_t send_holes_without_birth_time = 1;
|
||||
static int32_t zfs_traverse_indirect_prefetch_limit = 32;
|
||||
|
||||
typedef struct prefetch_data {
|
||||
kmutex_t pd_mtx;
|
||||
|
||||
+1
-2
@@ -683,8 +683,7 @@ dmu_tx_dirty_buf(dmu_tx_t *tx, dmu_buf_impl_t *db)
|
||||
* If we can't do 10 iops, something is wrong. Let us go ahead
|
||||
* and hit zfs_dirty_data_max.
|
||||
*/
|
||||
hrtime_t zfs_delay_max_ns = 100 * MICROSEC; /* 100 milliseconds */
|
||||
int zfs_delay_resolution_ns = 100 * 1000; /* 100 microseconds */
|
||||
static const hrtime_t zfs_delay_max_ns = 100 * MICROSEC; /* 100 milliseconds */
|
||||
|
||||
/*
|
||||
* We delay transactions when we've determined that the backend storage
|
||||
|
||||
@@ -43,12 +43,12 @@
|
||||
* so it can't hurt performance.
|
||||
*/
|
||||
|
||||
int zfs_prefetch_disable = B_FALSE;
|
||||
static int zfs_prefetch_disable = B_FALSE;
|
||||
|
||||
/* max # of streams per zfetch */
|
||||
unsigned int zfetch_max_streams = 8;
|
||||
static unsigned int zfetch_max_streams = 8;
|
||||
/* min time before stream reclaim */
|
||||
unsigned int zfetch_min_sec_reap = 2;
|
||||
static unsigned int zfetch_min_sec_reap = 2;
|
||||
/* max bytes to prefetch per stream (default 8MB) */
|
||||
unsigned int zfetch_max_distance = 8 * 1024 * 1024;
|
||||
/* max bytes to prefetch indirects for per stream (default 64MB) */
|
||||
@@ -83,7 +83,7 @@ struct {
|
||||
wmsum_add(&zfetch_sums.stat, val)
|
||||
|
||||
|
||||
kstat_t *zfetch_ksp;
|
||||
static kstat_t *zfetch_ksp;
|
||||
|
||||
static int
|
||||
zfetch_kstats_update(kstat_t *ksp, int rw)
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
* of this setting.
|
||||
*/
|
||||
int zfs_max_recordsize = 1 * 1024 * 1024;
|
||||
int zfs_allow_redacted_dataset_mount = 0;
|
||||
static int zfs_allow_redacted_dataset_mount = 0;
|
||||
|
||||
#define SWITCH64(x, y) \
|
||||
{ \
|
||||
@@ -896,14 +896,14 @@ dsl_dataset_own(dsl_pool_t *dp, const char *name, ds_hold_flags_t flags,
|
||||
* and accessed.
|
||||
*/
|
||||
void
|
||||
dsl_dataset_long_hold(dsl_dataset_t *ds, void *tag)
|
||||
dsl_dataset_long_hold(dsl_dataset_t *ds, const void *tag)
|
||||
{
|
||||
ASSERT(dsl_pool_config_held(ds->ds_dir->dd_pool));
|
||||
(void) zfs_refcount_add(&ds->ds_longholds, tag);
|
||||
}
|
||||
|
||||
void
|
||||
dsl_dataset_long_rele(dsl_dataset_t *ds, void *tag)
|
||||
dsl_dataset_long_rele(dsl_dataset_t *ds, const void *tag)
|
||||
{
|
||||
(void) zfs_refcount_remove(&ds->ds_longholds, tag);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ unsigned long zfs_wrlog_data_max = 0;
|
||||
* zfs_dirty_data_max), push out a txg. This should be less than
|
||||
* zfs_vdev_async_write_active_min_dirty_percent.
|
||||
*/
|
||||
int zfs_dirty_data_sync_percent = 20;
|
||||
static int zfs_dirty_data_sync_percent = 20;
|
||||
|
||||
/*
|
||||
* Once there is this amount of dirty data, the dmu_tx_delay() will kick in
|
||||
@@ -144,7 +144,7 @@ unsigned long zfs_delay_scale = 1000 * 1000 * 1000 / 2000;
|
||||
/*
|
||||
* This determines the number of threads used by the dp_sync_taskq.
|
||||
*/
|
||||
int zfs_sync_taskq_batch_pct = 75;
|
||||
static int zfs_sync_taskq_batch_pct = 75;
|
||||
|
||||
/*
|
||||
* These tunables determine the behavior of how zil_itxg_clean() is
|
||||
@@ -172,9 +172,9 @@ int zfs_sync_taskq_batch_pct = 75;
|
||||
* Additionally, the number of threads used by the taskq can be
|
||||
* configured via the "zfs_zil_clean_taskq_nthr_pct" tunable.
|
||||
*/
|
||||
int zfs_zil_clean_taskq_nthr_pct = 100;
|
||||
int zfs_zil_clean_taskq_minalloc = 1024;
|
||||
int zfs_zil_clean_taskq_maxalloc = 1024 * 1024;
|
||||
static int zfs_zil_clean_taskq_nthr_pct = 100;
|
||||
static int zfs_zil_clean_taskq_minalloc = 1024;
|
||||
static int zfs_zil_clean_taskq_maxalloc = 1024 * 1024;
|
||||
|
||||
int
|
||||
dsl_pool_open_special_dir(dsl_pool_t *dp, const char *name, dsl_dir_t **ddp)
|
||||
|
||||
+23
-22
@@ -136,7 +136,7 @@ extern int zfs_vdev_async_write_active_min_dirty_percent;
|
||||
* this value can be set to 1 to enable checking before scanning each
|
||||
* block.
|
||||
*/
|
||||
int zfs_scan_strict_mem_lim = B_FALSE;
|
||||
static int zfs_scan_strict_mem_lim = B_FALSE;
|
||||
|
||||
/*
|
||||
* Maximum number of parallelly executed bytes per leaf vdev. We attempt
|
||||
@@ -146,41 +146,42 @@ int zfs_scan_strict_mem_lim = B_FALSE;
|
||||
* overload the drives with I/O, since that is protected by
|
||||
* zfs_vdev_scrub_max_active.
|
||||
*/
|
||||
unsigned long zfs_scan_vdev_limit = 4 << 20;
|
||||
static unsigned long zfs_scan_vdev_limit = 4 << 20;
|
||||
|
||||
int zfs_scan_issue_strategy = 0;
|
||||
int zfs_scan_legacy = B_FALSE; /* don't queue & sort zios, go direct */
|
||||
unsigned long zfs_scan_max_ext_gap = 2 << 20; /* in bytes */
|
||||
static int zfs_scan_issue_strategy = 0;
|
||||
static int zfs_scan_legacy = B_FALSE; /* don't queue & sort zios, go direct */
|
||||
static unsigned long zfs_scan_max_ext_gap = 2 << 20; /* in bytes */
|
||||
|
||||
/*
|
||||
* fill_weight is non-tunable at runtime, so we copy it at module init from
|
||||
* zfs_scan_fill_weight. Runtime adjustments to zfs_scan_fill_weight would
|
||||
* break queue sorting.
|
||||
*/
|
||||
int zfs_scan_fill_weight = 3;
|
||||
static int zfs_scan_fill_weight = 3;
|
||||
static uint64_t fill_weight;
|
||||
|
||||
/* See dsl_scan_should_clear() for details on the memory limit tunables */
|
||||
uint64_t zfs_scan_mem_lim_min = 16 << 20; /* bytes */
|
||||
uint64_t zfs_scan_mem_lim_soft_max = 128 << 20; /* bytes */
|
||||
int zfs_scan_mem_lim_fact = 20; /* fraction of physmem */
|
||||
int zfs_scan_mem_lim_soft_fact = 20; /* fraction of mem lim above */
|
||||
static const uint64_t zfs_scan_mem_lim_min = 16 << 20; /* bytes */
|
||||
static const uint64_t zfs_scan_mem_lim_soft_max = 128 << 20; /* bytes */
|
||||
static int zfs_scan_mem_lim_fact = 20; /* fraction of physmem */
|
||||
static int zfs_scan_mem_lim_soft_fact = 20; /* fraction of mem lim above */
|
||||
|
||||
int zfs_scrub_min_time_ms = 1000; /* min millisecs to scrub per txg */
|
||||
int zfs_obsolete_min_time_ms = 500; /* min millisecs to obsolete per txg */
|
||||
int zfs_free_min_time_ms = 1000; /* min millisecs to free per txg */
|
||||
int zfs_resilver_min_time_ms = 3000; /* min millisecs to resilver per txg */
|
||||
int zfs_scan_checkpoint_intval = 7200; /* in seconds */
|
||||
static int zfs_scrub_min_time_ms = 1000; /* min millis to scrub per txg */
|
||||
static int zfs_obsolete_min_time_ms = 500; /* min millis to obsolete per txg */
|
||||
static int zfs_free_min_time_ms = 1000; /* min millis to free per txg */
|
||||
static int zfs_resilver_min_time_ms = 3000; /* min millis to resilver per txg */
|
||||
static int zfs_scan_checkpoint_intval = 7200; /* in seconds */
|
||||
int zfs_scan_suspend_progress = 0; /* set to prevent scans from progressing */
|
||||
int zfs_no_scrub_io = B_FALSE; /* set to disable scrub i/o */
|
||||
int zfs_no_scrub_prefetch = B_FALSE; /* set to disable scrub prefetch */
|
||||
enum ddt_class zfs_scrub_ddt_class_max = DDT_CLASS_DUPLICATE;
|
||||
static int zfs_no_scrub_io = B_FALSE; /* set to disable scrub i/o */
|
||||
static int zfs_no_scrub_prefetch = B_FALSE; /* set to disable scrub prefetch */
|
||||
static const enum ddt_class zfs_scrub_ddt_class_max = DDT_CLASS_DUPLICATE;
|
||||
/* max number of blocks to free in a single TXG */
|
||||
unsigned long zfs_async_block_max_blocks = ULONG_MAX;
|
||||
static unsigned long zfs_async_block_max_blocks = ULONG_MAX;
|
||||
/* max number of dedup blocks to free in a single TXG */
|
||||
unsigned long zfs_max_async_dedup_frees = 100000;
|
||||
static unsigned long zfs_max_async_dedup_frees = 100000;
|
||||
|
||||
int zfs_resilver_disable_defer = 0; /* set to disable resilver deferring */
|
||||
/* set to disable resilver deferring */
|
||||
static int zfs_resilver_disable_defer = B_FALSE;
|
||||
|
||||
/*
|
||||
* We wait a few txgs after importing a pool to begin scanning so that
|
||||
@@ -201,7 +202,7 @@ int zfs_resilver_disable_defer = 0; /* set to disable resilver deferring */
|
||||
/*
|
||||
* Enable/disable the processing of the free_bpobj object.
|
||||
*/
|
||||
int zfs_free_bpobj_enabled = 1;
|
||||
static int zfs_free_bpobj_enabled = 1;
|
||||
|
||||
/* the order has to match pool_scan_type */
|
||||
static scan_cb_t *scan_funcs[POOL_SCAN_FUNCS] = {
|
||||
|
||||
+2
-2
@@ -68,7 +68,7 @@
|
||||
#include <sys/condvar.h>
|
||||
#include <sys/zfs_ioctl.h>
|
||||
|
||||
int zfs_zevent_len_max = 512;
|
||||
static int zfs_zevent_len_max = 512;
|
||||
|
||||
static int zevent_len_cur = 0;
|
||||
static int zevent_waiters = 0;
|
||||
@@ -497,7 +497,7 @@ i_fm_free(nv_alloc_t *nva, void *buf, size_t size)
|
||||
kmem_free(buf, size);
|
||||
}
|
||||
|
||||
const nv_alloc_ops_t fm_mem_alloc_ops = {
|
||||
static const nv_alloc_ops_t fm_mem_alloc_ops = {
|
||||
.nv_ao_init = NULL,
|
||||
.nv_ao_fini = NULL,
|
||||
.nv_ao_alloc = i_fm_alloc,
|
||||
|
||||
+36
-42
@@ -51,7 +51,7 @@
|
||||
* operation, we will try to write this amount of data to a top-level vdev
|
||||
* before moving on to the next one.
|
||||
*/
|
||||
unsigned long metaslab_aliquot = 512 << 10;
|
||||
static unsigned long metaslab_aliquot = 512 << 10;
|
||||
|
||||
/*
|
||||
* For testing, make some blocks above a certain size be gang blocks.
|
||||
@@ -96,7 +96,7 @@ int zfs_condense_pct = 200;
|
||||
* uncondensed size consumes greater than zfs_metaslab_condense_block_threshold
|
||||
* blocks.
|
||||
*/
|
||||
int zfs_metaslab_condense_block_threshold = 4;
|
||||
static const int zfs_metaslab_condense_block_threshold = 4;
|
||||
|
||||
/*
|
||||
* The zfs_mg_noalloc_threshold defines which metaslab groups should
|
||||
@@ -111,7 +111,7 @@ int zfs_metaslab_condense_block_threshold = 4;
|
||||
* eligible to allocate on any metaslab group. The default value of 0 means
|
||||
* no metaslab group will be excluded based on this criterion.
|
||||
*/
|
||||
int zfs_mg_noalloc_threshold = 0;
|
||||
static int zfs_mg_noalloc_threshold = 0;
|
||||
|
||||
/*
|
||||
* Metaslab groups are considered eligible for allocations if their
|
||||
@@ -135,7 +135,7 @@ int zfs_mg_noalloc_threshold = 0;
|
||||
* enough to avoid hitting the speed bump on pools that are being pushed
|
||||
* to the edge.
|
||||
*/
|
||||
int zfs_mg_fragmentation_threshold = 95;
|
||||
static int zfs_mg_fragmentation_threshold = 95;
|
||||
|
||||
/*
|
||||
* Allow metaslabs to keep their active state as long as their fragmentation
|
||||
@@ -143,17 +143,17 @@ int zfs_mg_fragmentation_threshold = 95;
|
||||
* active metaslab that exceeds this threshold will no longer keep its active
|
||||
* status allowing better metaslabs to be selected.
|
||||
*/
|
||||
int zfs_metaslab_fragmentation_threshold = 70;
|
||||
static int zfs_metaslab_fragmentation_threshold = 70;
|
||||
|
||||
/*
|
||||
* When set will load all metaslabs when pool is first opened.
|
||||
*/
|
||||
int metaslab_debug_load = 0;
|
||||
int metaslab_debug_load = B_FALSE;
|
||||
|
||||
/*
|
||||
* When set will prevent metaslabs from being unloaded.
|
||||
*/
|
||||
int metaslab_debug_unload = 0;
|
||||
static int metaslab_debug_unload = B_FALSE;
|
||||
|
||||
/*
|
||||
* Minimum size which forces the dynamic allocator to change
|
||||
@@ -184,14 +184,14 @@ int metaslab_df_free_pct = 4;
|
||||
* With the default setting of 16MB this is 16*1024 (with ashift=9) or
|
||||
* 2048 (with ashift=12).
|
||||
*/
|
||||
int metaslab_df_max_search = 16 * 1024 * 1024;
|
||||
static int metaslab_df_max_search = 16 * 1024 * 1024;
|
||||
|
||||
/*
|
||||
* Forces the metaslab_block_picker function to search for at least this many
|
||||
* segments forwards until giving up on finding a segment that the allocation
|
||||
* will fit into.
|
||||
*/
|
||||
uint32_t metaslab_min_search_count = 100;
|
||||
static const uint32_t metaslab_min_search_count = 100;
|
||||
|
||||
/*
|
||||
* If we are not searching forward (due to metaslab_df_max_search,
|
||||
@@ -200,7 +200,7 @@ uint32_t metaslab_min_search_count = 100;
|
||||
* segment. If it is not set, we will use a segment of exactly the requested
|
||||
* size (or larger).
|
||||
*/
|
||||
int metaslab_df_use_largest_segment = B_FALSE;
|
||||
static int metaslab_df_use_largest_segment = B_FALSE;
|
||||
|
||||
/*
|
||||
* Percentage of all cpus that can be used by the metaslab taskq.
|
||||
@@ -215,8 +215,8 @@ int metaslab_load_pct = 50;
|
||||
* unloaded sooner. These settings are intended to be generous -- to keep
|
||||
* metaslabs loaded for a long time, reducing the rate of metaslab loading.
|
||||
*/
|
||||
int metaslab_unload_delay = 32;
|
||||
int metaslab_unload_delay_ms = 10 * 60 * 1000; /* ten minutes */
|
||||
static int metaslab_unload_delay = 32;
|
||||
static int metaslab_unload_delay_ms = 10 * 60 * 1000; /* ten minutes */
|
||||
|
||||
/*
|
||||
* Max number of metaslabs per group to preload.
|
||||
@@ -226,45 +226,45 @@ int metaslab_preload_limit = 10;
|
||||
/*
|
||||
* Enable/disable preloading of metaslab.
|
||||
*/
|
||||
int metaslab_preload_enabled = B_TRUE;
|
||||
static int metaslab_preload_enabled = B_TRUE;
|
||||
|
||||
/*
|
||||
* Enable/disable fragmentation weighting on metaslabs.
|
||||
*/
|
||||
int metaslab_fragmentation_factor_enabled = B_TRUE;
|
||||
static int metaslab_fragmentation_factor_enabled = B_TRUE;
|
||||
|
||||
/*
|
||||
* Enable/disable lba weighting (i.e. outer tracks are given preference).
|
||||
*/
|
||||
int metaslab_lba_weighting_enabled = B_TRUE;
|
||||
static int metaslab_lba_weighting_enabled = B_TRUE;
|
||||
|
||||
/*
|
||||
* Enable/disable metaslab group biasing.
|
||||
*/
|
||||
int metaslab_bias_enabled = B_TRUE;
|
||||
static int metaslab_bias_enabled = B_TRUE;
|
||||
|
||||
/*
|
||||
* Enable/disable remapping of indirect DVAs to their concrete vdevs.
|
||||
*/
|
||||
boolean_t zfs_remap_blkptr_enable = B_TRUE;
|
||||
static const boolean_t zfs_remap_blkptr_enable = B_TRUE;
|
||||
|
||||
/*
|
||||
* Enable/disable segment-based metaslab selection.
|
||||
*/
|
||||
int zfs_metaslab_segment_weight_enabled = B_TRUE;
|
||||
static int zfs_metaslab_segment_weight_enabled = B_TRUE;
|
||||
|
||||
/*
|
||||
* When using segment-based metaslab selection, we will continue
|
||||
* allocating from the active metaslab until we have exhausted
|
||||
* zfs_metaslab_switch_threshold of its buckets.
|
||||
*/
|
||||
int zfs_metaslab_switch_threshold = 2;
|
||||
static int zfs_metaslab_switch_threshold = 2;
|
||||
|
||||
/*
|
||||
* Internal switch to enable/disable the metaslab allocation tracing
|
||||
* facility.
|
||||
*/
|
||||
boolean_t metaslab_trace_enabled = B_FALSE;
|
||||
static const boolean_t metaslab_trace_enabled = B_FALSE;
|
||||
|
||||
/*
|
||||
* Maximum entries that the metaslab allocation tracing facility will keep
|
||||
@@ -274,32 +274,32 @@ boolean_t metaslab_trace_enabled = B_FALSE;
|
||||
* to every exceed this value. In debug mode, the system will panic if this
|
||||
* limit is ever reached allowing for further investigation.
|
||||
*/
|
||||
uint64_t metaslab_trace_max_entries = 5000;
|
||||
static const uint64_t metaslab_trace_max_entries = 5000;
|
||||
|
||||
/*
|
||||
* Maximum number of metaslabs per group that can be disabled
|
||||
* simultaneously.
|
||||
*/
|
||||
int max_disabled_ms = 3;
|
||||
static const int max_disabled_ms = 3;
|
||||
|
||||
/*
|
||||
* Time (in seconds) to respect ms_max_size when the metaslab is not loaded.
|
||||
* To avoid 64-bit overflow, don't set above UINT32_MAX.
|
||||
*/
|
||||
unsigned long zfs_metaslab_max_size_cache_sec = 3600; /* 1 hour */
|
||||
static unsigned long zfs_metaslab_max_size_cache_sec = 1 * 60 * 60; /* 1 hour */
|
||||
|
||||
/*
|
||||
* Maximum percentage of memory to use on storing loaded metaslabs. If loading
|
||||
* a metaslab would take it over this percentage, the oldest selected metaslab
|
||||
* is automatically unloaded.
|
||||
*/
|
||||
int zfs_metaslab_mem_limit = 25;
|
||||
static int zfs_metaslab_mem_limit = 25;
|
||||
|
||||
/*
|
||||
* Force the per-metaslab range trees to use 64-bit integers to store
|
||||
* segments. Used for debugging purposes.
|
||||
*/
|
||||
boolean_t zfs_metaslab_force_large_segs = B_FALSE;
|
||||
static const boolean_t zfs_metaslab_force_large_segs = B_FALSE;
|
||||
|
||||
/*
|
||||
* By default we only store segments over a certain size in the size-sorted
|
||||
@@ -308,7 +308,7 @@ boolean_t zfs_metaslab_force_large_segs = B_FALSE;
|
||||
* improves load and unload times at the cost of causing us to use slightly
|
||||
* larger segments than we would otherwise in some cases.
|
||||
*/
|
||||
uint32_t metaslab_by_size_min_shift = 14;
|
||||
static const uint32_t metaslab_by_size_min_shift = 14;
|
||||
|
||||
/*
|
||||
* If not set, we will first try normal allocation. If that fails then
|
||||
@@ -321,7 +321,7 @@ uint32_t metaslab_by_size_min_shift = 14;
|
||||
* allocation. If that fails we will do a "try hard" gang allocation. If
|
||||
* that fails then we will have a multi-layer gang block.
|
||||
*/
|
||||
int zfs_metaslab_try_hard_before_gang = B_FALSE;
|
||||
static int zfs_metaslab_try_hard_before_gang = B_FALSE;
|
||||
|
||||
/*
|
||||
* When not trying hard, we only consider the best zfs_metaslab_find_max_tries
|
||||
@@ -337,7 +337,7 @@ int zfs_metaslab_try_hard_before_gang = B_FALSE;
|
||||
* subsequent metaslab has ms_max_size >60KB (but fewer segments in this
|
||||
* bucket, and therefore a lower weight).
|
||||
*/
|
||||
int zfs_metaslab_find_max_tries = 100;
|
||||
static int zfs_metaslab_find_max_tries = 100;
|
||||
|
||||
static uint64_t metaslab_weight(metaslab_t *, boolean_t);
|
||||
static void metaslab_set_fragmentation(metaslab_t *, boolean_t);
|
||||
@@ -370,7 +370,7 @@ static metaslab_stats_t metaslab_stats = {
|
||||
atomic_inc_64(&metaslab_stats.stat.value.ui64);
|
||||
|
||||
|
||||
kstat_t *metaslab_ksp;
|
||||
static kstat_t *metaslab_ksp;
|
||||
|
||||
void
|
||||
metaslab_stat_init(void)
|
||||
@@ -406,7 +406,7 @@ metaslab_stat_fini(void)
|
||||
* ==========================================================================
|
||||
*/
|
||||
metaslab_class_t *
|
||||
metaslab_class_create(spa_t *spa, metaslab_ops_t *ops)
|
||||
metaslab_class_create(spa_t *spa, const metaslab_ops_t *ops)
|
||||
{
|
||||
metaslab_class_t *mc;
|
||||
|
||||
@@ -1478,7 +1478,7 @@ metaslab_rt_vacate(range_tree_t *rt, void *arg)
|
||||
metaslab_rt_create(rt, arg);
|
||||
}
|
||||
|
||||
static range_tree_ops_t metaslab_rt_ops = {
|
||||
static const range_tree_ops_t metaslab_rt_ops = {
|
||||
.rtop_create = metaslab_rt_create,
|
||||
.rtop_destroy = metaslab_rt_destroy,
|
||||
.rtop_add = metaslab_rt_add,
|
||||
@@ -1712,11 +1712,9 @@ metaslab_df_alloc(metaslab_t *msp, uint64_t size)
|
||||
return (offset);
|
||||
}
|
||||
|
||||
static metaslab_ops_t metaslab_df_ops = {
|
||||
const metaslab_ops_t zfs_metaslab_ops = {
|
||||
metaslab_df_alloc
|
||||
};
|
||||
|
||||
metaslab_ops_t *zfs_metaslab_ops = &metaslab_df_ops;
|
||||
#endif /* WITH_DF_BLOCK_ALLOCATOR */
|
||||
|
||||
#if defined(WITH_CF_BLOCK_ALLOCATOR)
|
||||
@@ -1762,11 +1760,9 @@ metaslab_cf_alloc(metaslab_t *msp, uint64_t size)
|
||||
return (offset);
|
||||
}
|
||||
|
||||
static metaslab_ops_t metaslab_cf_ops = {
|
||||
const metaslab_ops_t zfs_metaslab_ops = {
|
||||
metaslab_cf_alloc
|
||||
};
|
||||
|
||||
metaslab_ops_t *zfs_metaslab_ops = &metaslab_cf_ops;
|
||||
#endif /* WITH_CF_BLOCK_ALLOCATOR */
|
||||
|
||||
#if defined(WITH_NDF_BLOCK_ALLOCATOR)
|
||||
@@ -1826,11 +1822,9 @@ metaslab_ndf_alloc(metaslab_t *msp, uint64_t size)
|
||||
return (-1ULL);
|
||||
}
|
||||
|
||||
static metaslab_ops_t metaslab_ndf_ops = {
|
||||
const metaslab_ops_t zfs_metaslab_ops = {
|
||||
metaslab_ndf_alloc
|
||||
};
|
||||
|
||||
metaslab_ops_t *zfs_metaslab_ops = &metaslab_ndf_ops;
|
||||
#endif /* WITH_NDF_BLOCK_ALLOCATOR */
|
||||
|
||||
|
||||
@@ -2237,7 +2231,7 @@ metaslab_potentially_evict(metaslab_class_t *mc)
|
||||
}
|
||||
}
|
||||
#else
|
||||
(void) mc;
|
||||
(void) mc, (void) zfs_metaslab_mem_limit;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2855,7 +2849,7 @@ metaslab_fini(metaslab_t *msp)
|
||||
* of the table. Since the fragmentation value is never stored on disk, it
|
||||
* is possible to change these calculations in the future.
|
||||
*/
|
||||
int zfs_frag_table[FRAGMENTATION_TABLE_SIZE] = {
|
||||
static const int zfs_frag_table[FRAGMENTATION_TABLE_SIZE] = {
|
||||
100, /* 512B */
|
||||
100, /* 1K */
|
||||
98, /* 2K */
|
||||
|
||||
+1
-1
@@ -186,7 +186,7 @@ uint_t zfs_multihost_import_intervals = MMP_DEFAULT_IMPORT_INTERVALS;
|
||||
*/
|
||||
uint_t zfs_multihost_fail_intervals = MMP_DEFAULT_FAIL_INTERVALS;
|
||||
|
||||
char *mmp_tag = "mmp_write_uberblock";
|
||||
static void *const mmp_tag = "mmp_write_uberblock";
|
||||
static void mmp_thread(void *arg);
|
||||
|
||||
void
|
||||
|
||||
@@ -188,8 +188,8 @@ range_tree_seg_gap_compare(const void *x1, const void *x2)
|
||||
}
|
||||
|
||||
range_tree_t *
|
||||
range_tree_create_impl(range_tree_ops_t *ops, range_seg_type_t type, void *arg,
|
||||
uint64_t start, uint64_t shift,
|
||||
range_tree_create_impl(const range_tree_ops_t *ops, range_seg_type_t type,
|
||||
void *arg, uint64_t start, uint64_t shift,
|
||||
int (*zfs_btree_compare) (const void *, const void *),
|
||||
uint64_t gap)
|
||||
{
|
||||
@@ -232,7 +232,7 @@ range_tree_create_impl(range_tree_ops_t *ops, range_seg_type_t type, void *arg,
|
||||
}
|
||||
|
||||
range_tree_t *
|
||||
range_tree_create(range_tree_ops_t *ops, range_seg_type_t type,
|
||||
range_tree_create(const range_tree_ops_t *ops, range_seg_type_t type,
|
||||
void *arg, uint64_t start, uint64_t shift)
|
||||
{
|
||||
return (range_tree_create_impl(ops, type, arg, start, shift, NULL, 0));
|
||||
@@ -801,7 +801,7 @@ rt_btree_vacate(range_tree_t *rt, void *arg)
|
||||
rt_btree_create(rt, arg);
|
||||
}
|
||||
|
||||
range_tree_ops_t rt_btree_ops = {
|
||||
const range_tree_ops_t rt_btree_ops = {
|
||||
.rtop_create = rt_btree_create,
|
||||
.rtop_destroy = rt_btree_destroy,
|
||||
.rtop_add = rt_btree_add,
|
||||
|
||||
@@ -26,15 +26,15 @@
|
||||
#include <sys/zfs_context.h>
|
||||
#include <sys/zfs_refcount.h>
|
||||
|
||||
#ifdef ZFS_DEBUG
|
||||
/*
|
||||
* Reference count tracking is disabled by default. It's memory requirements
|
||||
* are reasonable, however as implemented it consumes a significant amount of
|
||||
* cpu time. Until its performance is improved it should be manually enabled.
|
||||
*/
|
||||
int reference_tracking_enable = FALSE;
|
||||
int reference_history = 3; /* tunable */
|
||||
int reference_tracking_enable = B_FALSE;
|
||||
static int reference_history = 3; /* tunable */
|
||||
|
||||
#ifdef ZFS_DEBUG
|
||||
static kmem_cache_t *reference_cache;
|
||||
static kmem_cache_t *reference_history_cache;
|
||||
|
||||
@@ -327,10 +327,10 @@ EXPORT_SYMBOL(zfs_refcount_remove);
|
||||
EXPORT_SYMBOL(zfs_refcount_held);
|
||||
|
||||
/* BEGIN CSTYLED */
|
||||
ZFS_MODULE_PARAM(zfs, ,reference_tracking_enable, INT, ZMOD_RW,
|
||||
ZFS_MODULE_PARAM(zfs, , reference_tracking_enable, INT, ZMOD_RW,
|
||||
"Track reference holders to refcount_t objects");
|
||||
|
||||
ZFS_MODULE_PARAM(zfs, ,reference_history, INT, ZMOD_RW,
|
||||
ZFS_MODULE_PARAM(zfs, , reference_history, INT, ZMOD_RW,
|
||||
"Maximum reference holders being tracked");
|
||||
/* END CSTYLED */
|
||||
#endif /* ZFS_DEBUG */
|
||||
|
||||
+11
-12
@@ -141,7 +141,7 @@ static int sa_modify_attrs(sa_handle_t *hdl, sa_attr_type_t newattr,
|
||||
sa_data_op_t action, sa_data_locator_t *locator, void *datastart,
|
||||
uint16_t buflen, dmu_tx_t *tx);
|
||||
|
||||
arc_byteswap_func_t sa_bswap_table[] = {
|
||||
static const arc_byteswap_func_t sa_bswap_table[] = {
|
||||
byteswap_uint64_array,
|
||||
byteswap_uint32_array,
|
||||
byteswap_uint16_array,
|
||||
@@ -178,7 +178,7 @@ do { \
|
||||
* won't have the registry. Only objsets of type ZFS_TYPE_FILESYSTEM will
|
||||
* use this static table.
|
||||
*/
|
||||
sa_attr_reg_t sa_legacy_attrs[] = {
|
||||
static const sa_attr_reg_t sa_legacy_attrs[] = {
|
||||
{"ZPL_ATIME", sizeof (uint64_t) * 2, SA_UINT64_ARRAY, 0},
|
||||
{"ZPL_MTIME", sizeof (uint64_t) * 2, SA_UINT64_ARRAY, 1},
|
||||
{"ZPL_CTIME", sizeof (uint64_t) * 2, SA_UINT64_ARRAY, 2},
|
||||
@@ -200,16 +200,16 @@ sa_attr_reg_t sa_legacy_attrs[] = {
|
||||
/*
|
||||
* This is only used for objects of type DMU_OT_ZNODE
|
||||
*/
|
||||
sa_attr_type_t sa_legacy_zpl_layout[] = {
|
||||
static const sa_attr_type_t sa_legacy_zpl_layout[] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
};
|
||||
|
||||
/*
|
||||
* Special dummy layout used for buffers with no attributes.
|
||||
*/
|
||||
sa_attr_type_t sa_dummy_zpl_layout[] = { 0 };
|
||||
static const sa_attr_type_t sa_dummy_zpl_layout[] = { 0 };
|
||||
|
||||
static int sa_legacy_attr_count = ARRAY_SIZE(sa_legacy_attrs);
|
||||
static const size_t sa_legacy_attr_count = ARRAY_SIZE(sa_legacy_attrs);
|
||||
static kmem_cache_t *sa_cache = NULL;
|
||||
|
||||
static int
|
||||
@@ -285,12 +285,11 @@ sa_layout_equal(sa_lot_t *tbf, sa_attr_type_t *attrs, int count)
|
||||
#define SA_ATTR_HASH(attr) (zfs_crc64_table[(-1ULL ^ attr) & 0xFF])
|
||||
|
||||
static uint64_t
|
||||
sa_layout_info_hash(sa_attr_type_t *attrs, int attr_count)
|
||||
sa_layout_info_hash(const sa_attr_type_t *attrs, int attr_count)
|
||||
{
|
||||
int i;
|
||||
uint64_t crc = -1ULL;
|
||||
|
||||
for (i = 0; i != attr_count; i++)
|
||||
for (int i = 0; i != attr_count; i++)
|
||||
crc ^= SA_ATTR_HASH(attrs[i]);
|
||||
|
||||
return (crc);
|
||||
@@ -402,7 +401,7 @@ sa_attr_op(sa_handle_t *hdl, sa_bulk_attr_t *bulk, int count,
|
||||
}
|
||||
|
||||
static sa_lot_t *
|
||||
sa_add_layout_entry(objset_t *os, sa_attr_type_t *attrs, int attr_count,
|
||||
sa_add_layout_entry(objset_t *os, const sa_attr_type_t *attrs, int attr_count,
|
||||
uint64_t lot_num, uint64_t hash, boolean_t zapadd, dmu_tx_t *tx)
|
||||
{
|
||||
sa_os_t *sa = os->os_sa;
|
||||
@@ -831,7 +830,7 @@ sa_free_attr_table(sa_os_t *sa)
|
||||
}
|
||||
|
||||
static int
|
||||
sa_attr_table_setup(objset_t *os, sa_attr_reg_t *reg_attrs, int count)
|
||||
sa_attr_table_setup(objset_t *os, const sa_attr_reg_t *reg_attrs, int count)
|
||||
{
|
||||
sa_os_t *sa = os->os_sa;
|
||||
uint64_t sa_attr_count = 0;
|
||||
@@ -992,8 +991,8 @@ bail:
|
||||
}
|
||||
|
||||
int
|
||||
sa_setup(objset_t *os, uint64_t sa_obj, sa_attr_reg_t *reg_attrs, int count,
|
||||
sa_attr_type_t **user_table)
|
||||
sa_setup(objset_t *os, uint64_t sa_obj, const sa_attr_reg_t *reg_attrs,
|
||||
int count, sa_attr_type_t **user_table)
|
||||
{
|
||||
zap_cursor_t zc;
|
||||
zap_attribute_t za;
|
||||
|
||||
+23
-21
@@ -150,7 +150,7 @@ static const char *const zio_taskq_types[ZIO_TASKQ_TYPES] = {
|
||||
* and interrupt) and then to reserve threads for ZIO_PRIORITY_NOW I/Os that
|
||||
* need to be handled with minimum delay.
|
||||
*/
|
||||
const zio_taskq_info_t zio_taskqs[ZIO_TYPES][ZIO_TASKQ_TYPES] = {
|
||||
static const zio_taskq_info_t zio_taskqs[ZIO_TYPES][ZIO_TASKQ_TYPES] = {
|
||||
/* ISSUE ISSUE_HIGH INTR INTR_HIGH */
|
||||
{ ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, /* NULL */
|
||||
{ ZTI_N(8), ZTI_NULL, ZTI_SCALE, ZTI_NULL }, /* READ */
|
||||
@@ -167,12 +167,12 @@ static boolean_t spa_has_active_shared_spare(spa_t *spa);
|
||||
static int spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport);
|
||||
static void spa_vdev_resilver_done(spa_t *spa);
|
||||
|
||||
uint_t zio_taskq_batch_pct = 80; /* 1 thread per cpu in pset */
|
||||
uint_t zio_taskq_batch_tpq; /* threads per taskq */
|
||||
boolean_t zio_taskq_sysdc = B_TRUE; /* use SDC scheduling class */
|
||||
uint_t zio_taskq_basedc = 80; /* base duty cycle */
|
||||
static uint_t zio_taskq_batch_pct = 80; /* 1 thread per cpu in pset */
|
||||
static uint_t zio_taskq_batch_tpq; /* threads per taskq */
|
||||
static const boolean_t zio_taskq_sysdc = B_TRUE; /* use SDC scheduling class */
|
||||
static const uint_t zio_taskq_basedc = 80; /* base duty cycle */
|
||||
|
||||
boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */
|
||||
static const boolean_t spa_create_process = B_TRUE; /* no process => no sysdc */
|
||||
|
||||
/*
|
||||
* Report any spa_load_verify errors found, but do not fail spa_load.
|
||||
@@ -195,7 +195,7 @@ boolean_t spa_mode_readable_spacemaps = B_FALSE;
|
||||
/*
|
||||
* For debugging purposes: print out vdev tree during pool import.
|
||||
*/
|
||||
int spa_load_print_vdev_tree = B_FALSE;
|
||||
static int spa_load_print_vdev_tree = B_FALSE;
|
||||
|
||||
/*
|
||||
* A non-zero value for zfs_max_missing_tvds means that we allow importing
|
||||
@@ -244,28 +244,28 @@ uint64_t zfs_max_missing_tvds_scan = 0;
|
||||
/*
|
||||
* Debugging aid that pauses spa_sync() towards the end.
|
||||
*/
|
||||
boolean_t zfs_pause_spa_sync = B_FALSE;
|
||||
static const boolean_t zfs_pause_spa_sync = B_FALSE;
|
||||
|
||||
/*
|
||||
* Variables to indicate the livelist condense zthr func should wait at certain
|
||||
* points for the livelist to be removed - used to test condense/destroy races
|
||||
*/
|
||||
int zfs_livelist_condense_zthr_pause = 0;
|
||||
int zfs_livelist_condense_sync_pause = 0;
|
||||
static int zfs_livelist_condense_zthr_pause = 0;
|
||||
static int zfs_livelist_condense_sync_pause = 0;
|
||||
|
||||
/*
|
||||
* Variables to track whether or not condense cancellation has been
|
||||
* triggered in testing.
|
||||
*/
|
||||
int zfs_livelist_condense_sync_cancel = 0;
|
||||
int zfs_livelist_condense_zthr_cancel = 0;
|
||||
static int zfs_livelist_condense_sync_cancel = 0;
|
||||
static int zfs_livelist_condense_zthr_cancel = 0;
|
||||
|
||||
/*
|
||||
* Variable to track whether or not extra ALLOC blkptrs were added to a
|
||||
* livelist entry while it was being condensed (caused by the way we track
|
||||
* remapped blkptrs in dbuf_remap_impl)
|
||||
*/
|
||||
int zfs_livelist_condense_new_alloc = 0;
|
||||
static int zfs_livelist_condense_new_alloc = 0;
|
||||
|
||||
/*
|
||||
* ==========================================================================
|
||||
@@ -1048,6 +1048,7 @@ spa_taskqs_init(spa_t *spa, zio_type_t t, zio_taskq_type_t q)
|
||||
if (batch)
|
||||
flags |= TASKQ_DC_BATCH;
|
||||
|
||||
(void) zio_taskq_basedc;
|
||||
tq = taskq_create_sysdc(name, value, 50, INT_MAX,
|
||||
spa->spa_proc, zio_taskq_basedc, flags);
|
||||
} else {
|
||||
@@ -1249,12 +1250,12 @@ spa_activate(spa_t *spa, spa_mode_t mode)
|
||||
spa->spa_mode = mode;
|
||||
spa->spa_read_spacemaps = spa_mode_readable_spacemaps;
|
||||
|
||||
spa->spa_normal_class = metaslab_class_create(spa, zfs_metaslab_ops);
|
||||
spa->spa_log_class = metaslab_class_create(spa, zfs_metaslab_ops);
|
||||
spa->spa_normal_class = metaslab_class_create(spa, &zfs_metaslab_ops);
|
||||
spa->spa_log_class = metaslab_class_create(spa, &zfs_metaslab_ops);
|
||||
spa->spa_embedded_log_class =
|
||||
metaslab_class_create(spa, zfs_metaslab_ops);
|
||||
spa->spa_special_class = metaslab_class_create(spa, zfs_metaslab_ops);
|
||||
spa->spa_dedup_class = metaslab_class_create(spa, zfs_metaslab_ops);
|
||||
metaslab_class_create(spa, &zfs_metaslab_ops);
|
||||
spa->spa_special_class = metaslab_class_create(spa, &zfs_metaslab_ops);
|
||||
spa->spa_dedup_class = metaslab_class_create(spa, &zfs_metaslab_ops);
|
||||
|
||||
/* Try to create a covering process */
|
||||
mutex_enter(&spa->spa_proc_lock);
|
||||
@@ -1262,6 +1263,7 @@ spa_activate(spa_t *spa, spa_mode_t mode)
|
||||
ASSERT(spa->spa_proc == &p0);
|
||||
spa->spa_did = 0;
|
||||
|
||||
(void) spa_create_process;
|
||||
#ifdef HAVE_SPA_THREAD
|
||||
/* Only create a process if we're going to be around a while. */
|
||||
if (spa_create_process && strcmp(spa->spa_name, TRYIMPORT_NAME) != 0) {
|
||||
@@ -2281,9 +2283,9 @@ spa_load_verify_done(zio_t *zio)
|
||||
* Maximum number of inflight bytes is the log2 fraction of the arc size.
|
||||
* By default, we set it to 1/16th of the arc.
|
||||
*/
|
||||
int spa_load_verify_shift = 4;
|
||||
int spa_load_verify_metadata = B_TRUE;
|
||||
int spa_load_verify_data = B_TRUE;
|
||||
static int spa_load_verify_shift = 4;
|
||||
static int spa_load_verify_metadata = B_TRUE;
|
||||
static int spa_load_verify_data = B_TRUE;
|
||||
|
||||
static int
|
||||
spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
* amount of checkpointed data that has been freed within them while
|
||||
* the pool had a checkpoint.
|
||||
*/
|
||||
unsigned long zfs_spa_discard_memory_limit = 16 * 1024 * 1024;
|
||||
static unsigned long zfs_spa_discard_memory_limit = 16 * 1024 * 1024;
|
||||
|
||||
int
|
||||
spa_checkpoint_get_stats(spa_t *spa, pool_checkpoint_stat_t *pcs)
|
||||
|
||||
@@ -68,7 +68,9 @@ static uint64_t spa_config_generation = 1;
|
||||
* userland pools when doing testing.
|
||||
*/
|
||||
char *spa_config_path = ZPOOL_CACHE;
|
||||
int zfs_autoimport_disable = 1;
|
||||
#ifdef _KERNEL
|
||||
static int zfs_autoimport_disable = B_TRUE;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Called when the module is first loaded, this routine loads the configuration
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
* block size as we expect to be writing a lot of data to them at
|
||||
* once.
|
||||
*/
|
||||
unsigned long zfs_log_sm_blksz = 1ULL << 17;
|
||||
static const unsigned long zfs_log_sm_blksz = 1ULL << 17;
|
||||
|
||||
/*
|
||||
* Percentage of the overall system's memory that ZFS allows to be
|
||||
@@ -188,13 +188,13 @@ unsigned long zfs_log_sm_blksz = 1ULL << 17;
|
||||
* (thus the _ppm suffix; reads as "parts per million"). As an example,
|
||||
* the default of 1000 allows 0.1% of memory to be used.
|
||||
*/
|
||||
unsigned long zfs_unflushed_max_mem_ppm = 1000;
|
||||
static unsigned long zfs_unflushed_max_mem_ppm = 1000;
|
||||
|
||||
/*
|
||||
* Specific hard-limit in memory that ZFS allows to be used for
|
||||
* unflushed changes.
|
||||
*/
|
||||
unsigned long zfs_unflushed_max_mem_amt = 1ULL << 30;
|
||||
static unsigned long zfs_unflushed_max_mem_amt = 1ULL << 30;
|
||||
|
||||
/*
|
||||
* The following tunable determines the number of blocks that can be used for
|
||||
@@ -243,28 +243,28 @@ unsigned long zfs_unflushed_max_mem_amt = 1ULL << 30;
|
||||
* provide upper and lower bounds for the log block limit.
|
||||
* [see zfs_unflushed_log_block_{min,max}]
|
||||
*/
|
||||
unsigned long zfs_unflushed_log_block_pct = 400;
|
||||
static unsigned long zfs_unflushed_log_block_pct = 400;
|
||||
|
||||
/*
|
||||
* If the number of metaslabs is small and our incoming rate is high, we could
|
||||
* get into a situation that we are flushing all our metaslabs every TXG. Thus
|
||||
* we always allow at least this many log blocks.
|
||||
*/
|
||||
unsigned long zfs_unflushed_log_block_min = 1000;
|
||||
static unsigned long zfs_unflushed_log_block_min = 1000;
|
||||
|
||||
/*
|
||||
* If the log becomes too big, the import time of the pool can take a hit in
|
||||
* terms of performance. Thus we have a hard limit in the size of the log in
|
||||
* terms of blocks.
|
||||
*/
|
||||
unsigned long zfs_unflushed_log_block_max = (1ULL << 18);
|
||||
static unsigned long zfs_unflushed_log_block_max = (1ULL << 18);
|
||||
|
||||
/*
|
||||
* Max # of rows allowed for the log_summary. The tradeoff here is accuracy and
|
||||
* stability of the flushing algorithm (longer summary) vs its runtime overhead
|
||||
* (smaller summary is faster to traverse).
|
||||
*/
|
||||
unsigned long zfs_max_logsm_summary_length = 10;
|
||||
static unsigned long zfs_max_logsm_summary_length = 10;
|
||||
|
||||
/*
|
||||
* Tunable that sets the lower bound on the metaslabs to flush every TXG.
|
||||
@@ -277,7 +277,7 @@ unsigned long zfs_max_logsm_summary_length = 10;
|
||||
* The point of this tunable is to be used in extreme cases where we really
|
||||
* want to flush more metaslabs than our adaptable heuristic plans to flush.
|
||||
*/
|
||||
unsigned long zfs_min_metaslabs_to_flush = 1;
|
||||
static unsigned long zfs_min_metaslabs_to_flush = 1;
|
||||
|
||||
/*
|
||||
* Tunable that specifies how far in the past do we want to look when trying to
|
||||
@@ -288,7 +288,7 @@ unsigned long zfs_min_metaslabs_to_flush = 1;
|
||||
* average over all the blocks that we walk
|
||||
* [see spa_estimate_incoming_log_blocks].
|
||||
*/
|
||||
unsigned long zfs_max_log_walking = 5;
|
||||
static unsigned long zfs_max_log_walking = 5;
|
||||
|
||||
/*
|
||||
* This tunable exists solely for testing purposes. It ensures that the log
|
||||
|
||||
+12
-13
@@ -235,14 +235,13 @@
|
||||
static avl_tree_t spa_namespace_avl;
|
||||
kmutex_t spa_namespace_lock;
|
||||
static kcondvar_t spa_namespace_cv;
|
||||
int spa_max_replication_override = SPA_DVAS_PER_BP;
|
||||
static const 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;
|
||||
spa_mode_t spa_mode_global = SPA_MODE_UNINIT;
|
||||
|
||||
#ifdef ZFS_DEBUG
|
||||
@@ -304,25 +303,25 @@ int zfs_free_leak_on_eio = B_FALSE;
|
||||
* has not completed in zfs_deadman_synctime_ms is considered "hung" resulting
|
||||
* in one of three behaviors controlled by zfs_deadman_failmode.
|
||||
*/
|
||||
unsigned long zfs_deadman_synctime_ms = 600000UL;
|
||||
unsigned long zfs_deadman_synctime_ms = 600000UL; /* 10 min. */
|
||||
|
||||
/*
|
||||
* This value controls the maximum amount of time zio_wait() will block for an
|
||||
* outstanding IO. By default this is 300 seconds at which point the "hung"
|
||||
* behavior will be applied as described for zfs_deadman_synctime_ms.
|
||||
*/
|
||||
unsigned long zfs_deadman_ziotime_ms = 300000UL;
|
||||
unsigned long zfs_deadman_ziotime_ms = 300000UL; /* 5 min. */
|
||||
|
||||
/*
|
||||
* Check time in milliseconds. This defines the frequency at which we check
|
||||
* for hung I/O.
|
||||
*/
|
||||
unsigned long zfs_deadman_checktime_ms = 60000UL;
|
||||
unsigned long zfs_deadman_checktime_ms = 60000UL; /* 1 min. */
|
||||
|
||||
/*
|
||||
* By default the deadman is enabled.
|
||||
*/
|
||||
int zfs_deadman_enabled = 1;
|
||||
int zfs_deadman_enabled = B_TRUE;
|
||||
|
||||
/*
|
||||
* Controls the behavior of the deadman when it detects a "hung" I/O.
|
||||
@@ -332,7 +331,7 @@ int zfs_deadman_enabled = 1;
|
||||
* continue - Attempt to recover from a "hung" I/O
|
||||
* panic - Panic the system
|
||||
*/
|
||||
char *zfs_deadman_failmode = "wait";
|
||||
const char *zfs_deadman_failmode = "wait";
|
||||
|
||||
/*
|
||||
* The worst case is single-sector max-parity RAID-Z blocks, in which
|
||||
@@ -384,9 +383,9 @@ int spa_asize_inflation = 24;
|
||||
* See also the comments in zfs_space_check_t.
|
||||
*/
|
||||
int spa_slop_shift = 5;
|
||||
uint64_t spa_min_slop = 128ULL * 1024 * 1024;
|
||||
uint64_t spa_max_slop = 128ULL * 1024 * 1024 * 1024;
|
||||
int spa_allocators = 4;
|
||||
static const uint64_t spa_min_slop = 128ULL * 1024 * 1024;
|
||||
static const uint64_t spa_max_slop = 128ULL * 1024 * 1024 * 1024;
|
||||
static const int spa_allocators = 4;
|
||||
|
||||
|
||||
void
|
||||
@@ -420,15 +419,15 @@ spa_load_note(spa_t *spa, const char *fmt, ...)
|
||||
/*
|
||||
* By default dedup and user data indirects land in the special class
|
||||
*/
|
||||
int zfs_ddt_data_is_special = B_TRUE;
|
||||
int zfs_user_indirect_is_special = B_TRUE;
|
||||
static int zfs_ddt_data_is_special = B_TRUE;
|
||||
static int zfs_user_indirect_is_special = B_TRUE;
|
||||
|
||||
/*
|
||||
* The percentage of special class final space reserved for metadata only.
|
||||
* Once we allocate 100 - zfs_special_class_metadata_reserve_pct we only
|
||||
* let metadata into the class.
|
||||
*/
|
||||
int zfs_special_class_metadata_reserve_pct = 25;
|
||||
static int zfs_special_class_metadata_reserve_pct = 25;
|
||||
|
||||
/*
|
||||
* ==========================================================================
|
||||
|
||||
@@ -28,22 +28,22 @@
|
||||
/*
|
||||
* Keeps stats on last N reads per spa_t, disabled by default.
|
||||
*/
|
||||
int zfs_read_history = 0;
|
||||
static int zfs_read_history = B_FALSE;
|
||||
|
||||
/*
|
||||
* Include cache hits in history, disabled by default.
|
||||
*/
|
||||
int zfs_read_history_hits = 0;
|
||||
static int zfs_read_history_hits = B_FALSE;
|
||||
|
||||
/*
|
||||
* Keeps stats on the last 100 txgs by default.
|
||||
*/
|
||||
int zfs_txg_history = 100;
|
||||
static int zfs_txg_history = 100;
|
||||
|
||||
/*
|
||||
* Keeps stats on the last N MMP updates, disabled by default.
|
||||
*/
|
||||
int zfs_multihost_history = 0;
|
||||
int zfs_multihost_history = B_FALSE;
|
||||
|
||||
/*
|
||||
* ==========================================================================
|
||||
@@ -830,7 +830,7 @@ spa_health_destroy(spa_t *spa)
|
||||
mutex_destroy(&shk->lock);
|
||||
}
|
||||
|
||||
static spa_iostats_t spa_iostats_template = {
|
||||
static const spa_iostats_t spa_iostats_template = {
|
||||
{ "trim_extents_written", KSTAT_DATA_UINT64 },
|
||||
{ "trim_bytes_written", KSTAT_DATA_UINT64 },
|
||||
{ "trim_extents_skipped", KSTAT_DATA_UINT64 },
|
||||
|
||||
+11
-11
@@ -81,22 +81,22 @@
|
||||
* 1 << (spa_slop_shift + 1), on small pools the usable space may be reduced
|
||||
* (by more than 1<<spa_slop_shift) due to the embedded slog metaslab.
|
||||
*/
|
||||
int zfs_embedded_slog_min_ms = 64;
|
||||
static int zfs_embedded_slog_min_ms = 64;
|
||||
|
||||
/* default target for number of metaslabs per top-level vdev */
|
||||
int zfs_vdev_default_ms_count = 200;
|
||||
static int zfs_vdev_default_ms_count = 200;
|
||||
|
||||
/* minimum number of metaslabs per top-level vdev */
|
||||
int zfs_vdev_min_ms_count = 16;
|
||||
static int zfs_vdev_min_ms_count = 16;
|
||||
|
||||
/* practical upper limit of total metaslabs per top-level vdev */
|
||||
int zfs_vdev_ms_count_limit = 1ULL << 17;
|
||||
static int zfs_vdev_ms_count_limit = 1ULL << 17;
|
||||
|
||||
/* lower limit for metaslab size (512M) */
|
||||
int zfs_vdev_default_ms_shift = 29;
|
||||
static int zfs_vdev_default_ms_shift = 29;
|
||||
|
||||
/* upper limit for metaslab size (16G) */
|
||||
int zfs_vdev_max_ms_shift = 34;
|
||||
static const int zfs_vdev_max_ms_shift = 34;
|
||||
|
||||
int vdev_validate_skip = B_FALSE;
|
||||
|
||||
@@ -109,18 +109,18 @@ int zfs_vdev_dtl_sm_blksz = (1 << 12);
|
||||
/*
|
||||
* Rate limit slow IO (delay) events to this many per second.
|
||||
*/
|
||||
unsigned int zfs_slow_io_events_per_second = 20;
|
||||
static unsigned int zfs_slow_io_events_per_second = 20;
|
||||
|
||||
/*
|
||||
* Rate limit checksum events after this many checksum errors per second.
|
||||
*/
|
||||
unsigned int zfs_checksum_events_per_second = 20;
|
||||
static unsigned int zfs_checksum_events_per_second = 20;
|
||||
|
||||
/*
|
||||
* Ignore errors during scrub/resilver. Allows to work around resilver
|
||||
* upon import when there are pool errors.
|
||||
*/
|
||||
int zfs_scan_ignore_errors = 0;
|
||||
static int zfs_scan_ignore_errors = 0;
|
||||
|
||||
/*
|
||||
* vdev-wide space maps that have lots of entries written to them at
|
||||
@@ -216,7 +216,7 @@ vdev_dbgmsg_print_tree(vdev_t *vd, int indent)
|
||||
* Virtual device management.
|
||||
*/
|
||||
|
||||
static vdev_ops_t *vdev_ops_table[] = {
|
||||
static const vdev_ops_t *const vdev_ops_table[] = {
|
||||
&vdev_root_ops,
|
||||
&vdev_raidz_ops,
|
||||
&vdev_draid_ops,
|
||||
@@ -238,7 +238,7 @@ static vdev_ops_t *vdev_ops_table[] = {
|
||||
static vdev_ops_t *
|
||||
vdev_getops(const char *type)
|
||||
{
|
||||
vdev_ops_t *ops, **opspp;
|
||||
const vdev_ops_t *ops, *const *opspp;
|
||||
|
||||
for (opspp = vdev_ops_table; (ops = *opspp) != NULL; opspp++)
|
||||
if (strcmp(ops->vdev_op_type, type) == 0)
|
||||
|
||||
@@ -83,13 +83,13 @@
|
||||
* it by setting the zfs_vdev_cache_size to zero. Note that Solaris 11
|
||||
* has made these same changes.
|
||||
*/
|
||||
int zfs_vdev_cache_max = 1<<14; /* 16KB */
|
||||
int zfs_vdev_cache_size = 0;
|
||||
int zfs_vdev_cache_bshift = 16;
|
||||
static int zfs_vdev_cache_max = 1<<14; /* 16KB */
|
||||
static int zfs_vdev_cache_size = 0;
|
||||
static int zfs_vdev_cache_bshift = 16;
|
||||
|
||||
#define VCBS (1 << zfs_vdev_cache_bshift) /* 64KB */
|
||||
|
||||
kstat_t *vdc_ksp = NULL;
|
||||
static kstat_t *vdc_ksp = NULL;
|
||||
|
||||
typedef struct vdc_stats {
|
||||
kstat_named_t vdc_stat_delegations;
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
* object.
|
||||
*/
|
||||
|
||||
int zfs_condense_indirect_vdevs_enable = B_TRUE;
|
||||
static int zfs_condense_indirect_vdevs_enable = B_TRUE;
|
||||
|
||||
/*
|
||||
* Condense if at least this percent of the bytes in the mapping is
|
||||
@@ -181,7 +181,7 @@ int zfs_condense_indirect_vdevs_enable = B_TRUE;
|
||||
* condenses. Higher values will condense less often (causing less
|
||||
* i/o); lower values will reduce the mapping size more quickly.
|
||||
*/
|
||||
int zfs_condense_indirect_obsolete_pct = 25;
|
||||
static int zfs_condense_indirect_obsolete_pct = 25;
|
||||
|
||||
/*
|
||||
* Condense if the obsolete space map takes up more than this amount of
|
||||
@@ -189,14 +189,14 @@ int zfs_condense_indirect_obsolete_pct = 25;
|
||||
* consumed by the obsolete space map; the default of 1GB is small enough
|
||||
* that we typically don't mind "wasting" it.
|
||||
*/
|
||||
unsigned long zfs_condense_max_obsolete_bytes = 1024 * 1024 * 1024;
|
||||
static unsigned long zfs_condense_max_obsolete_bytes = 1024 * 1024 * 1024;
|
||||
|
||||
/*
|
||||
* Don't bother condensing if the mapping uses less than this amount of
|
||||
* memory. The default of 128KB is considered a "trivial" amount of
|
||||
* memory and not worth reducing.
|
||||
*/
|
||||
unsigned long zfs_condense_min_mapping_bytes = 128 * 1024;
|
||||
static unsigned long zfs_condense_min_mapping_bytes = 128 * 1024;
|
||||
|
||||
/*
|
||||
* This is used by the test suite so that it can ensure that certain
|
||||
@@ -204,7 +204,7 @@ unsigned long zfs_condense_min_mapping_bytes = 128 * 1024;
|
||||
* complete too quickly). If used to reduce the performance impact of
|
||||
* condensing in production, a maximum value of 1 should be sufficient.
|
||||
*/
|
||||
int zfs_condense_indirect_commit_entry_delay_ms = 0;
|
||||
static int zfs_condense_indirect_commit_entry_delay_ms = 0;
|
||||
|
||||
/*
|
||||
* If an indirect split block contains more than this many possible unique
|
||||
|
||||
@@ -37,16 +37,16 @@
|
||||
* Value that is written to disk during initialization.
|
||||
*/
|
||||
#ifdef _ILP32
|
||||
unsigned long zfs_initialize_value = 0xdeadbeefUL;
|
||||
static unsigned long zfs_initialize_value = 0xdeadbeefUL;
|
||||
#else
|
||||
unsigned long zfs_initialize_value = 0xdeadbeefdeadbeeeULL;
|
||||
static unsigned long zfs_initialize_value = 0xdeadbeefdeadbeeeULL;
|
||||
#endif
|
||||
|
||||
/* maximum number of I/Os outstanding per leaf vdev */
|
||||
int zfs_initialize_limit = 1;
|
||||
static const int zfs_initialize_limit = 1;
|
||||
|
||||
/* size of initializing writes; default 1MiB, see zfs_remove_max_segment */
|
||||
unsigned long zfs_initialize_chunk_size = 1024 * 1024;
|
||||
static unsigned long zfs_initialize_chunk_size = 1024 * 1024;
|
||||
|
||||
static boolean_t
|
||||
vdev_initialize_should_stop(vdev_t *vd)
|
||||
|
||||
@@ -121,7 +121,7 @@ typedef struct mirror_map {
|
||||
mirror_child_t mm_child[];
|
||||
} mirror_map_t;
|
||||
|
||||
static int vdev_mirror_shift = 21;
|
||||
static const int vdev_mirror_shift = 21;
|
||||
|
||||
/*
|
||||
* The load configuration settings below are tuned by default for
|
||||
|
||||
+25
-25
@@ -141,24 +141,24 @@ uint32_t zfs_vdev_max_active = 1000;
|
||||
* more quickly, but reads and writes to have higher latency and lower
|
||||
* throughput.
|
||||
*/
|
||||
uint32_t zfs_vdev_sync_read_min_active = 10;
|
||||
uint32_t zfs_vdev_sync_read_max_active = 10;
|
||||
uint32_t zfs_vdev_sync_write_min_active = 10;
|
||||
uint32_t zfs_vdev_sync_write_max_active = 10;
|
||||
uint32_t zfs_vdev_async_read_min_active = 1;
|
||||
uint32_t zfs_vdev_async_read_max_active = 3;
|
||||
uint32_t zfs_vdev_async_write_min_active = 2;
|
||||
uint32_t zfs_vdev_async_write_max_active = 10;
|
||||
uint32_t zfs_vdev_scrub_min_active = 1;
|
||||
uint32_t zfs_vdev_scrub_max_active = 3;
|
||||
uint32_t zfs_vdev_removal_min_active = 1;
|
||||
uint32_t zfs_vdev_removal_max_active = 2;
|
||||
uint32_t zfs_vdev_initializing_min_active = 1;
|
||||
uint32_t zfs_vdev_initializing_max_active = 1;
|
||||
uint32_t zfs_vdev_trim_min_active = 1;
|
||||
uint32_t zfs_vdev_trim_max_active = 2;
|
||||
uint32_t zfs_vdev_rebuild_min_active = 1;
|
||||
uint32_t zfs_vdev_rebuild_max_active = 3;
|
||||
static uint32_t zfs_vdev_sync_read_min_active = 10;
|
||||
static uint32_t zfs_vdev_sync_read_max_active = 10;
|
||||
static uint32_t zfs_vdev_sync_write_min_active = 10;
|
||||
static uint32_t zfs_vdev_sync_write_max_active = 10;
|
||||
static uint32_t zfs_vdev_async_read_min_active = 1;
|
||||
/* */ uint32_t zfs_vdev_async_read_max_active = 3;
|
||||
static uint32_t zfs_vdev_async_write_min_active = 2;
|
||||
/* */ uint32_t zfs_vdev_async_write_max_active = 10;
|
||||
static uint32_t zfs_vdev_scrub_min_active = 1;
|
||||
static uint32_t zfs_vdev_scrub_max_active = 3;
|
||||
static uint32_t zfs_vdev_removal_min_active = 1;
|
||||
static uint32_t zfs_vdev_removal_max_active = 2;
|
||||
static uint32_t zfs_vdev_initializing_min_active = 1;
|
||||
static uint32_t zfs_vdev_initializing_max_active = 1;
|
||||
static uint32_t zfs_vdev_trim_min_active = 1;
|
||||
static uint32_t zfs_vdev_trim_max_active = 2;
|
||||
static uint32_t zfs_vdev_rebuild_min_active = 1;
|
||||
static uint32_t zfs_vdev_rebuild_max_active = 3;
|
||||
|
||||
/*
|
||||
* When the pool has less than zfs_vdev_async_write_active_min_dirty_percent
|
||||
@@ -178,7 +178,7 @@ int zfs_vdev_async_write_active_max_dirty_percent = 60;
|
||||
* interactive I/O, then the vdev is considered to be "idle", and the number
|
||||
* of concurrently-active non-interactive I/O's is increased to *_max_active.
|
||||
*/
|
||||
uint_t zfs_vdev_nia_delay = 5;
|
||||
static uint_t zfs_vdev_nia_delay = 5;
|
||||
|
||||
/*
|
||||
* Some HDDs tend to prioritize sequential I/O so high that concurrent
|
||||
@@ -190,7 +190,7 @@ uint_t zfs_vdev_nia_delay = 5;
|
||||
* I/Os. This enforced wait ensures the HDD services the interactive I/O
|
||||
* within a reasonable amount of time.
|
||||
*/
|
||||
uint_t zfs_vdev_nia_credit = 5;
|
||||
static uint_t zfs_vdev_nia_credit = 5;
|
||||
|
||||
/*
|
||||
* To reduce IOPs, we aggregate small adjacent I/Os into one large I/O.
|
||||
@@ -198,10 +198,10 @@ uint_t zfs_vdev_nia_credit = 5;
|
||||
* we include spans of optional I/Os to aid aggregation at the disk even when
|
||||
* they aren't able to help us aggregate at this level.
|
||||
*/
|
||||
int zfs_vdev_aggregation_limit = 1 << 20;
|
||||
int zfs_vdev_aggregation_limit_non_rotating = SPA_OLD_MAXBLOCKSIZE;
|
||||
int zfs_vdev_read_gap_limit = 32 << 10;
|
||||
int zfs_vdev_write_gap_limit = 4 << 10;
|
||||
static int zfs_vdev_aggregation_limit = 1 << 20;
|
||||
static int zfs_vdev_aggregation_limit_non_rotating = SPA_OLD_MAXBLOCKSIZE;
|
||||
static int zfs_vdev_read_gap_limit = 32 << 10;
|
||||
static int zfs_vdev_write_gap_limit = 4 << 10;
|
||||
|
||||
/*
|
||||
* Define the queue depth percentage for each top-level. This percentage is
|
||||
@@ -233,7 +233,7 @@ int zfs_vdev_def_queue_depth = 32;
|
||||
* TRIM I/O for extents up to zfs_trim_extent_bytes_max (128M) can be submitted
|
||||
* by the TRIM code in zfs_trim.c.
|
||||
*/
|
||||
int zfs_vdev_aggregate_trim = 0;
|
||||
static int zfs_vdev_aggregate_trim = 0;
|
||||
|
||||
static int
|
||||
vdev_queue_offset_compare(const void *x1, const void *x2)
|
||||
|
||||
@@ -43,7 +43,7 @@ static raidz_impl_ops_t vdev_raidz_fastest_impl = {
|
||||
};
|
||||
|
||||
/* All compiled in implementations */
|
||||
const raidz_impl_ops_t *raidz_all_maths[] = {
|
||||
static const raidz_impl_ops_t *const raidz_all_maths[] = {
|
||||
&vdev_raidz_original_impl,
|
||||
&vdev_raidz_scalar_impl,
|
||||
#if defined(__x86_64) && defined(HAVE_SSE2) /* only x86_64 for now */
|
||||
@@ -268,10 +268,10 @@ vdev_raidz_math_reconstruct(raidz_map_t *rm, raidz_row_t *rr,
|
||||
return (rec_fn(rr, dt));
|
||||
}
|
||||
|
||||
const char *raidz_gen_name[] = {
|
||||
const char *const raidz_gen_name[] = {
|
||||
"gen_p", "gen_pq", "gen_pqr"
|
||||
};
|
||||
const char *raidz_rec_name[] = {
|
||||
const char *const raidz_rec_name[] = {
|
||||
"rec_p", "rec_q", "rec_r",
|
||||
"rec_pq", "rec_pr", "rec_qr", "rec_pqr"
|
||||
};
|
||||
@@ -283,18 +283,15 @@ const char *raidz_rec_name[] = {
|
||||
static int
|
||||
raidz_math_kstat_headers(char *buf, size_t size)
|
||||
{
|
||||
int i;
|
||||
ssize_t off;
|
||||
|
||||
ASSERT3U(size, >=, RAIDZ_KSTAT_LINE_LEN);
|
||||
|
||||
off = snprintf(buf, size, "%-17s", "implementation");
|
||||
ssize_t off = snprintf(buf, size, "%-17s", "implementation");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(raidz_gen_name); i++)
|
||||
for (int i = 0; i < ARRAY_SIZE(raidz_gen_name); i++)
|
||||
off += snprintf(buf + off, size - off, "%-16s",
|
||||
raidz_gen_name[i]);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(raidz_rec_name); i++)
|
||||
for (int i = 0; i < ARRAY_SIZE(raidz_rec_name); i++)
|
||||
off += snprintf(buf + off, size - off, "%-16s",
|
||||
raidz_rec_name[i]);
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
* Size of rebuild reads; defaults to 1MiB per data disk and is capped at
|
||||
* SPA_MAXBLOCKSIZE.
|
||||
*/
|
||||
unsigned long zfs_rebuild_max_segment = 1024 * 1024;
|
||||
static unsigned long zfs_rebuild_max_segment = 1024 * 1024;
|
||||
|
||||
/*
|
||||
* Maximum number of parallelly executed bytes per leaf vdev caused by a
|
||||
@@ -121,14 +121,14 @@ unsigned long zfs_rebuild_max_segment = 1024 * 1024;
|
||||
* With a value of 32MB the sequential resilver write rate was measured at
|
||||
* 800MB/s sustained while rebuilding to a distributed spare.
|
||||
*/
|
||||
unsigned long zfs_rebuild_vdev_limit = 32 << 20;
|
||||
static unsigned long zfs_rebuild_vdev_limit = 32 << 20;
|
||||
|
||||
/*
|
||||
* Automatically start a pool scrub when the last active sequential resilver
|
||||
* completes in order to verify the checksums of all blocks which have been
|
||||
* resilvered. This option is enabled by default and is strongly recommended.
|
||||
*/
|
||||
int zfs_rebuild_scrub_enabled = 1;
|
||||
static int zfs_rebuild_scrub_enabled = 1;
|
||||
|
||||
/*
|
||||
* For vdev_rebuild_initiate_sync() and vdev_rebuild_reset_sync().
|
||||
|
||||
@@ -94,7 +94,7 @@ typedef struct vdev_copy_arg {
|
||||
* doing a device removal. This determines how much i/o we can have
|
||||
* in flight concurrently.
|
||||
*/
|
||||
int zfs_remove_max_copy_bytes = 64 * 1024 * 1024;
|
||||
static const int zfs_remove_max_copy_bytes = 64 * 1024 * 1024;
|
||||
|
||||
/*
|
||||
* The largest contiguous segment that we will attempt to allocate when
|
||||
@@ -112,7 +112,7 @@ int zfs_remove_max_segment = SPA_MAXBLOCKSIZE;
|
||||
* not be cancelled. This can result in a normally recoverable block
|
||||
* becoming permanently damaged and is not recommended.
|
||||
*/
|
||||
int zfs_removal_ignore_errors = 0;
|
||||
static int zfs_removal_ignore_errors = 0;
|
||||
|
||||
/*
|
||||
* Allow a remap segment to span free chunks of at most this size. The main
|
||||
|
||||
@@ -96,12 +96,12 @@
|
||||
/*
|
||||
* Maximum size of TRIM I/O, ranges will be chunked in to 128MiB lengths.
|
||||
*/
|
||||
unsigned int zfs_trim_extent_bytes_max = 128 * 1024 * 1024;
|
||||
static unsigned int zfs_trim_extent_bytes_max = 128 * 1024 * 1024;
|
||||
|
||||
/*
|
||||
* Minimum size of TRIM I/O, extents smaller than 32Kib will be skipped.
|
||||
*/
|
||||
unsigned int zfs_trim_extent_bytes_min = 32 * 1024;
|
||||
static unsigned int zfs_trim_extent_bytes_min = 32 * 1024;
|
||||
|
||||
/*
|
||||
* Skip uninitialized metaslabs during the TRIM process. This option is
|
||||
@@ -118,7 +118,7 @@ unsigned int zfs_trim_metaslab_skip = 0;
|
||||
* concurrent TRIM I/Os issued to the device is controlled by the
|
||||
* zfs_vdev_trim_min_active and zfs_vdev_trim_max_active module options.
|
||||
*/
|
||||
unsigned int zfs_trim_queue_limit = 10;
|
||||
static unsigned int zfs_trim_queue_limit = 10;
|
||||
|
||||
/*
|
||||
* The minimum number of transaction groups between automatic trims of a
|
||||
@@ -134,7 +134,7 @@ unsigned int zfs_trim_queue_limit = 10;
|
||||
* has the opposite effect. The default value of 32 was determined though
|
||||
* testing to be a reasonable compromise.
|
||||
*/
|
||||
unsigned int zfs_trim_txg_batch = 32;
|
||||
static unsigned int zfs_trim_txg_batch = 32;
|
||||
|
||||
/*
|
||||
* The trim_args are a control structure which describe how a leaf vdev
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@
|
||||
* the zfs-specific implementation of the directory's st_size (which is
|
||||
* the number of entries).
|
||||
*/
|
||||
int zap_iterate_prefetch = B_TRUE;
|
||||
static int zap_iterate_prefetch = B_TRUE;
|
||||
|
||||
int fzap_default_block_shift = 14; /* 16k blocksize */
|
||||
|
||||
|
||||
+7
-7
@@ -108,7 +108,7 @@
|
||||
|
||||
#define ZCP_NVLIST_MAX_DEPTH 20
|
||||
|
||||
uint64_t zfs_lua_check_instrlimit_interval = 100;
|
||||
static const uint64_t zfs_lua_check_instrlimit_interval = 100;
|
||||
unsigned long zfs_lua_max_instrlimit = ZCP_MAX_INSTRLIMIT;
|
||||
unsigned long zfs_lua_max_memlimit = ZCP_MAX_MEMLIMIT;
|
||||
|
||||
@@ -631,11 +631,11 @@ zcp_dataset_hold(lua_State *state, dsl_pool_t *dp, const char *dsname,
|
||||
}
|
||||
|
||||
static int zcp_debug(lua_State *);
|
||||
static zcp_lib_info_t zcp_debug_info = {
|
||||
static const zcp_lib_info_t zcp_debug_info = {
|
||||
.name = "debug",
|
||||
.func = zcp_debug,
|
||||
.pargs = {
|
||||
{ .za_name = "debug string", .za_lua_type = LUA_TSTRING},
|
||||
{ .za_name = "debug string", .za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -648,7 +648,7 @@ zcp_debug(lua_State *state)
|
||||
{
|
||||
const char *dbgstring;
|
||||
zcp_run_info_t *ri = zcp_run_info(state);
|
||||
zcp_lib_info_t *libinfo = &zcp_debug_info;
|
||||
const zcp_lib_info_t *libinfo = &zcp_debug_info;
|
||||
|
||||
zcp_parse_args(state, libinfo->name, libinfo->pargs, libinfo->kwargs);
|
||||
|
||||
@@ -661,11 +661,11 @@ zcp_debug(lua_State *state)
|
||||
}
|
||||
|
||||
static int zcp_exists(lua_State *);
|
||||
static zcp_lib_info_t zcp_exists_info = {
|
||||
static const zcp_lib_info_t zcp_exists_info = {
|
||||
.name = "exists",
|
||||
.func = zcp_exists,
|
||||
.pargs = {
|
||||
{ .za_name = "dataset", .za_lua_type = LUA_TSTRING},
|
||||
{ .za_name = "dataset", .za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -678,7 +678,7 @@ zcp_exists(lua_State *state)
|
||||
{
|
||||
zcp_run_info_t *ri = zcp_run_info(state);
|
||||
dsl_pool_t *dp = ri->zri_pool;
|
||||
zcp_lib_info_t *libinfo = &zcp_exists_info;
|
||||
const zcp_lib_info_t *libinfo = &zcp_exists_info;
|
||||
|
||||
zcp_parse_args(state, libinfo->name, libinfo->pargs, libinfo->kwargs);
|
||||
|
||||
|
||||
@@ -743,12 +743,12 @@ zcp_get_written_prop(lua_State *state, dsl_pool_t *dp,
|
||||
}
|
||||
|
||||
static int zcp_get_prop(lua_State *state);
|
||||
static zcp_lib_info_t zcp_get_prop_info = {
|
||||
static const zcp_lib_info_t zcp_get_prop_info = {
|
||||
.name = "get_prop",
|
||||
.func = zcp_get_prop,
|
||||
.pargs = {
|
||||
{ .za_name = "dataset", .za_lua_type = LUA_TSTRING},
|
||||
{ .za_name = "property", .za_lua_type = LUA_TSTRING},
|
||||
{ .za_name = "dataset", .za_lua_type = LUA_TSTRING },
|
||||
{ .za_name = "property", .za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -762,7 +762,7 @@ zcp_get_prop(lua_State *state)
|
||||
const char *dataset_name;
|
||||
const char *property_name;
|
||||
dsl_pool_t *dp = zcp_run_info(state)->zri_pool;
|
||||
zcp_lib_info_t *libinfo = &zcp_get_prop_info;
|
||||
const zcp_lib_info_t *libinfo = &zcp_get_prop_info;
|
||||
|
||||
zcp_parse_args(state, libinfo->name, libinfo->pargs, libinfo->kwargs);
|
||||
|
||||
|
||||
+21
-23
@@ -107,12 +107,12 @@ zcp_clones_iter(lua_State *state)
|
||||
}
|
||||
|
||||
static int zcp_clones_list(lua_State *);
|
||||
static zcp_list_info_t zcp_clones_list_info = {
|
||||
static const zcp_list_info_t zcp_clones_list_info = {
|
||||
.name = "clones",
|
||||
.func = zcp_clones_list,
|
||||
.gc = NULL,
|
||||
.pargs = {
|
||||
{ .za_name = "snapshot", .za_lua_type = LUA_TSTRING},
|
||||
{ .za_name = "snapshot", .za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -194,12 +194,12 @@ zcp_snapshots_iter(lua_State *state)
|
||||
}
|
||||
|
||||
static int zcp_snapshots_list(lua_State *);
|
||||
static zcp_list_info_t zcp_snapshots_list_info = {
|
||||
static const zcp_list_info_t zcp_snapshots_list_info = {
|
||||
.name = "snapshots",
|
||||
.func = zcp_snapshots_list,
|
||||
.gc = NULL,
|
||||
.pargs = {
|
||||
{ .za_name = "filesystem | volume", .za_lua_type = LUA_TSTRING},
|
||||
{ .za_name = "filesystem | volume", .za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -281,12 +281,12 @@ zcp_children_iter(lua_State *state)
|
||||
}
|
||||
|
||||
static int zcp_children_list(lua_State *);
|
||||
static zcp_list_info_t zcp_children_list_info = {
|
||||
static const zcp_list_info_t zcp_children_list_info = {
|
||||
.name = "children",
|
||||
.func = zcp_children_list,
|
||||
.gc = NULL,
|
||||
.pargs = {
|
||||
{ .za_name = "filesystem | volume", .za_lua_type = LUA_TSTRING},
|
||||
{ .za_name = "filesystem | volume", .za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -361,13 +361,13 @@ zcp_user_props_iter(lua_State *state)
|
||||
}
|
||||
|
||||
static int zcp_user_props_list(lua_State *);
|
||||
static zcp_list_info_t zcp_user_props_list_info = {
|
||||
static const zcp_list_info_t zcp_user_props_list_info = {
|
||||
.name = "user_properties",
|
||||
.func = zcp_user_props_list,
|
||||
.gc = zcp_user_props_list_gc,
|
||||
.pargs = {
|
||||
{ .za_name = "filesystem | snapshot | volume",
|
||||
.za_lua_type = LUA_TSTRING},
|
||||
.za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -383,13 +383,13 @@ static zcp_list_info_t zcp_user_props_list_info = {
|
||||
* versions of ZFS, we declare 'properties' as an alias for
|
||||
* 'user_properties'.
|
||||
*/
|
||||
static zcp_list_info_t zcp_props_list_info = {
|
||||
static const zcp_list_info_t zcp_props_list_info = {
|
||||
.name = "properties",
|
||||
.func = zcp_user_props_list,
|
||||
.gc = zcp_user_props_list_gc,
|
||||
.pargs = {
|
||||
{ .za_name = "filesystem | snapshot | volume",
|
||||
.za_lua_type = LUA_TSTRING},
|
||||
.za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -444,11 +444,11 @@ zcp_dataset_system_props(dsl_dataset_t *ds, nvlist_t *nv)
|
||||
}
|
||||
|
||||
static int zcp_system_props_list(lua_State *);
|
||||
static zcp_list_info_t zcp_system_props_list_info = {
|
||||
static const zcp_list_info_t zcp_system_props_list_info = {
|
||||
.name = "system_properties",
|
||||
.func = zcp_system_props_list,
|
||||
.pargs = {
|
||||
{ .za_name = "dataset", .za_lua_type = LUA_TSTRING},
|
||||
{ .za_name = "dataset", .za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -467,7 +467,7 @@ zcp_system_props_list(lua_State *state)
|
||||
char errbuf[128];
|
||||
const char *dataset_name;
|
||||
dsl_pool_t *dp = zcp_run_info(state)->zri_pool;
|
||||
zcp_list_info_t *libinfo = &zcp_system_props_list_info;
|
||||
const zcp_list_info_t *libinfo = &zcp_system_props_list_info;
|
||||
zcp_parse_args(state, libinfo->name, libinfo->pargs, libinfo->kwargs);
|
||||
dataset_name = lua_tostring(state, 1);
|
||||
nvlist_t *nv = fnvlist_alloc();
|
||||
@@ -566,11 +566,11 @@ zcp_bookmarks_iter(lua_State *state)
|
||||
}
|
||||
|
||||
static int zcp_bookmarks_list(lua_State *);
|
||||
static zcp_list_info_t zcp_bookmarks_list_info = {
|
||||
static const zcp_list_info_t zcp_bookmarks_list_info = {
|
||||
.name = "bookmarks",
|
||||
.func = zcp_bookmarks_list,
|
||||
.pargs = {
|
||||
{ .za_name = "dataset", .za_lua_type = LUA_TSTRING},
|
||||
{ .za_name = "dataset", .za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -654,12 +654,12 @@ zcp_holds_iter(lua_State *state)
|
||||
}
|
||||
|
||||
static int zcp_holds_list(lua_State *);
|
||||
static zcp_list_info_t zcp_holds_list_info = {
|
||||
static const zcp_list_info_t zcp_holds_list_info = {
|
||||
.name = "holds",
|
||||
.func = zcp_holds_list,
|
||||
.gc = NULL,
|
||||
.pargs = {
|
||||
{ .za_name = "snapshot", .za_lua_type = LUA_TSTRING},
|
||||
{ .za_name = "snapshot", .za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -710,8 +710,7 @@ zcp_list_func(lua_State *state)
|
||||
int
|
||||
zcp_load_list_lib(lua_State *state)
|
||||
{
|
||||
int i;
|
||||
zcp_list_info_t *zcp_list_funcs[] = {
|
||||
const zcp_list_info_t *zcp_list_funcs[] = {
|
||||
&zcp_children_list_info,
|
||||
&zcp_snapshots_list_info,
|
||||
&zcp_user_props_list_info,
|
||||
@@ -725,8 +724,8 @@ zcp_load_list_lib(lua_State *state)
|
||||
|
||||
lua_newtable(state);
|
||||
|
||||
for (i = 0; zcp_list_funcs[i] != NULL; i++) {
|
||||
zcp_list_info_t *info = zcp_list_funcs[i];
|
||||
for (int i = 0; zcp_list_funcs[i] != NULL; i++) {
|
||||
const zcp_list_info_t *info = zcp_list_funcs[i];
|
||||
|
||||
if (info->gc != NULL) {
|
||||
/*
|
||||
@@ -741,10 +740,9 @@ zcp_load_list_lib(lua_State *state)
|
||||
lua_pop(state, 1);
|
||||
}
|
||||
|
||||
lua_pushlightuserdata(state, info);
|
||||
lua_pushlightuserdata(state, (void *)(uintptr_t)info);
|
||||
lua_pushcclosure(state, &zcp_list_func, 1);
|
||||
lua_setfield(state, -2, info->name);
|
||||
info++;
|
||||
}
|
||||
|
||||
return (1);
|
||||
|
||||
+21
-23
@@ -114,15 +114,15 @@ zcp_sync_task(lua_State *state, dsl_checkfunc_t *checkfunc,
|
||||
|
||||
|
||||
static int zcp_synctask_destroy(lua_State *, boolean_t, nvlist_t *);
|
||||
static zcp_synctask_info_t zcp_synctask_destroy_info = {
|
||||
static const zcp_synctask_info_t zcp_synctask_destroy_info = {
|
||||
.name = "destroy",
|
||||
.func = zcp_synctask_destroy,
|
||||
.pargs = {
|
||||
{.za_name = "filesystem | snapshot", .za_lua_type = LUA_TSTRING},
|
||||
{.za_name = "filesystem | snapshot", .za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
{.za_name = "defer", .za_lua_type = LUA_TBOOLEAN},
|
||||
{.za_name = "defer", .za_lua_type = LUA_TBOOLEAN },
|
||||
{NULL, 0}
|
||||
},
|
||||
.space_check = ZFS_SPACE_CHECK_DESTROY,
|
||||
@@ -167,11 +167,11 @@ zcp_synctask_destroy(lua_State *state, boolean_t sync, nvlist_t *err_details)
|
||||
}
|
||||
|
||||
static int zcp_synctask_promote(lua_State *, boolean_t, nvlist_t *);
|
||||
static zcp_synctask_info_t zcp_synctask_promote_info = {
|
||||
static const zcp_synctask_info_t zcp_synctask_promote_info = {
|
||||
.name = "promote",
|
||||
.func = zcp_synctask_promote,
|
||||
.pargs = {
|
||||
{.za_name = "clone", .za_lua_type = LUA_TSTRING},
|
||||
{.za_name = "clone", .za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -205,13 +205,13 @@ zcp_synctask_promote(lua_State *state, boolean_t sync, nvlist_t *err_details)
|
||||
}
|
||||
|
||||
static int zcp_synctask_rollback(lua_State *, boolean_t, nvlist_t *err_details);
|
||||
static zcp_synctask_info_t zcp_synctask_rollback_info = {
|
||||
static const zcp_synctask_info_t zcp_synctask_rollback_info = {
|
||||
.name = "rollback",
|
||||
.func = zcp_synctask_rollback,
|
||||
.space_check = ZFS_SPACE_CHECK_RESERVED,
|
||||
.blocks_modified = 1,
|
||||
.pargs = {
|
||||
{.za_name = "filesystem", .za_lua_type = LUA_TSTRING},
|
||||
{.za_name = "filesystem", .za_lua_type = LUA_TSTRING },
|
||||
{0, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -236,12 +236,12 @@ zcp_synctask_rollback(lua_State *state, boolean_t sync, nvlist_t *err_details)
|
||||
}
|
||||
|
||||
static int zcp_synctask_snapshot(lua_State *, boolean_t, nvlist_t *);
|
||||
static zcp_synctask_info_t zcp_synctask_snapshot_info = {
|
||||
static const zcp_synctask_info_t zcp_synctask_snapshot_info = {
|
||||
.name = "snapshot",
|
||||
.func = zcp_synctask_snapshot,
|
||||
.pargs = {
|
||||
{.za_name = "filesystem@snapname | volume@snapname",
|
||||
.za_lua_type = LUA_TSTRING},
|
||||
.za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -304,7 +304,7 @@ zcp_synctask_snapshot(lua_State *state, boolean_t sync, nvlist_t *err_details)
|
||||
|
||||
static int zcp_synctask_inherit_prop(lua_State *, boolean_t,
|
||||
nvlist_t *err_details);
|
||||
static zcp_synctask_info_t zcp_synctask_inherit_prop_info = {
|
||||
static const zcp_synctask_info_t zcp_synctask_inherit_prop_info = {
|
||||
.name = "inherit",
|
||||
.func = zcp_synctask_inherit_prop,
|
||||
.space_check = ZFS_SPACE_CHECK_RESERVED,
|
||||
@@ -382,12 +382,12 @@ zcp_synctask_inherit_prop(lua_State *state, boolean_t sync,
|
||||
}
|
||||
|
||||
static int zcp_synctask_bookmark(lua_State *, boolean_t, nvlist_t *);
|
||||
static zcp_synctask_info_t zcp_synctask_bookmark_info = {
|
||||
static const zcp_synctask_info_t zcp_synctask_bookmark_info = {
|
||||
.name = "bookmark",
|
||||
.func = zcp_synctask_bookmark,
|
||||
.pargs = {
|
||||
{.za_name = "snapshot | bookmark", .za_lua_type = LUA_TSTRING},
|
||||
{.za_name = "bookmark", .za_lua_type = LUA_TSTRING},
|
||||
{.za_name = "snapshot | bookmark", .za_lua_type = LUA_TSTRING },
|
||||
{.za_name = "bookmark", .za_lua_type = LUA_TSTRING },
|
||||
{NULL, 0}
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -425,15 +425,15 @@ zcp_synctask_bookmark(lua_State *state, boolean_t sync, nvlist_t *err_details)
|
||||
}
|
||||
|
||||
static int zcp_synctask_set_prop(lua_State *, boolean_t, nvlist_t *err_details);
|
||||
static zcp_synctask_info_t zcp_synctask_set_prop_info = {
|
||||
static const zcp_synctask_info_t zcp_synctask_set_prop_info = {
|
||||
.name = "set_prop",
|
||||
.func = zcp_synctask_set_prop,
|
||||
.space_check = ZFS_SPACE_CHECK_RESERVED,
|
||||
.blocks_modified = 2,
|
||||
.pargs = {
|
||||
{ .za_name = "dataset", .za_lua_type = LUA_TSTRING},
|
||||
{ .za_name = "property", .za_lua_type = LUA_TSTRING},
|
||||
{ .za_name = "value", .za_lua_type = LUA_TSTRING},
|
||||
{ .za_name = "dataset", .za_lua_type = LUA_TSTRING },
|
||||
{ .za_name = "property", .za_lua_type = LUA_TSTRING },
|
||||
{ .za_name = "value", .za_lua_type = LUA_TSTRING },
|
||||
{ NULL, 0 }
|
||||
},
|
||||
.kwargs = {
|
||||
@@ -524,8 +524,7 @@ zcp_synctask_wrapper(lua_State *state)
|
||||
int
|
||||
zcp_load_synctask_lib(lua_State *state, boolean_t sync)
|
||||
{
|
||||
int i;
|
||||
zcp_synctask_info_t *zcp_synctask_funcs[] = {
|
||||
const zcp_synctask_info_t *zcp_synctask_funcs[] = {
|
||||
&zcp_synctask_destroy_info,
|
||||
&zcp_synctask_promote_info,
|
||||
&zcp_synctask_rollback_info,
|
||||
@@ -538,13 +537,12 @@ zcp_load_synctask_lib(lua_State *state, boolean_t sync)
|
||||
|
||||
lua_newtable(state);
|
||||
|
||||
for (i = 0; zcp_synctask_funcs[i] != NULL; i++) {
|
||||
zcp_synctask_info_t *info = zcp_synctask_funcs[i];
|
||||
lua_pushlightuserdata(state, info);
|
||||
for (int i = 0; zcp_synctask_funcs[i] != NULL; i++) {
|
||||
const zcp_synctask_info_t *info = zcp_synctask_funcs[i];
|
||||
lua_pushlightuserdata(state, (void *)(uintptr_t)info);
|
||||
lua_pushboolean(state, sync);
|
||||
lua_pushcclosure(state, &zcp_synctask_wrapper, 2);
|
||||
lua_setfield(state, -2, info->name);
|
||||
info++;
|
||||
}
|
||||
|
||||
return (1);
|
||||
|
||||
+2
-2
@@ -124,14 +124,14 @@ static taskqid_t recent_events_cleaner_tqid;
|
||||
* This setting can be changed dynamically and setting it to zero
|
||||
* disables duplicate detection.
|
||||
*/
|
||||
unsigned int zfs_zevent_retain_max = 2000;
|
||||
static unsigned int zfs_zevent_retain_max = 2000;
|
||||
|
||||
/*
|
||||
* The lifespan for a recent ereport entry. The default of 15 minutes is
|
||||
* intended to outlive the zfs diagnosis engine's threshold of 10 errors
|
||||
* over a period of 10 minutes.
|
||||
*/
|
||||
unsigned int zfs_zevent_retain_expire_secs = 900;
|
||||
static unsigned int zfs_zevent_retain_expire_secs = 900;
|
||||
|
||||
typedef enum zfs_subclass {
|
||||
ZSC_IO,
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
#include <sys/zfs_ioctl_impl.h>
|
||||
|
||||
kmutex_t zfsdev_state_lock;
|
||||
zfsdev_state_t *zfsdev_state_list;
|
||||
static zfsdev_state_t *zfsdev_state_list;
|
||||
|
||||
/*
|
||||
* Limit maximum nvlist size. We don't want users passing in insane values
|
||||
@@ -236,7 +236,7 @@ unsigned long zfs_max_nvlist_src_size = 0;
|
||||
* the logged size to this many bytes. This must be less than DMU_MAX_ACCESS.
|
||||
* This applies primarily to zfs_ioc_channel_program().
|
||||
*/
|
||||
unsigned long zfs_history_output_max = 1024 * 1024;
|
||||
static unsigned long zfs_history_output_max = 1024 * 1024;
|
||||
|
||||
uint_t zfs_fsyncer_key;
|
||||
uint_t zfs_allow_log_key;
|
||||
@@ -6095,10 +6095,6 @@ zfs_ioc_share(zfs_cmd_t *zc)
|
||||
return (SET_ERROR(ENOSYS));
|
||||
}
|
||||
|
||||
ace_t full_access[] = {
|
||||
{(uid_t)-1, ACE_ALL_PERMS, ACE_EVERYONE, 0}
|
||||
};
|
||||
|
||||
/*
|
||||
* inputs:
|
||||
* zc_name name of containing filesystem
|
||||
|
||||
@@ -530,7 +530,7 @@ zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, znode_t *sdzp,
|
||||
* called as soon as the write is on stable storage (be it via a DMU sync or a
|
||||
* ZIL commit).
|
||||
*/
|
||||
long zfs_immediate_write_sz = 32768;
|
||||
static long zfs_immediate_write_sz = 32768;
|
||||
|
||||
void
|
||||
zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype,
|
||||
|
||||
@@ -967,7 +967,7 @@ zfs_replay_acl(void *arg1, void *arg2, boolean_t byteswap)
|
||||
/*
|
||||
* Callback vectors for replaying records
|
||||
*/
|
||||
zil_replay_func_t *zfs_replay_vector[TX_MAX_TYPE] = {
|
||||
zil_replay_func_t *const zfs_replay_vector[TX_MAX_TYPE] = {
|
||||
zfs_replay_error, /* no such type */
|
||||
zfs_replay_create, /* TX_CREATE */
|
||||
zfs_replay_create, /* TX_MKDIR */
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@
|
||||
* this version of ZFS won't change or delete them.
|
||||
*/
|
||||
|
||||
sa_attr_reg_t zfs_attr_table[ZPL_END+1] = {
|
||||
const sa_attr_reg_t zfs_attr_table[ZPL_END+1] = {
|
||||
{"ZPL_ATIME", sizeof (uint64_t) * 2, SA_UINT64_ARRAY, 0},
|
||||
{"ZPL_MTIME", sizeof (uint64_t) * 2, SA_UINT64_ARRAY, 1},
|
||||
{"ZPL_CTIME", sizeof (uint64_t) * 2, SA_UINT64_ARRAY, 2},
|
||||
|
||||
+9
-8
@@ -89,12 +89,12 @@
|
||||
* committed to stable storage. Please refer to the zil_commit_waiter()
|
||||
* function (and the comments within it) for more details.
|
||||
*/
|
||||
int zfs_commit_timeout_pct = 5;
|
||||
static int zfs_commit_timeout_pct = 5;
|
||||
|
||||
/*
|
||||
* See zil.h for more information about these fields.
|
||||
*/
|
||||
zil_stats_t zil_stats = {
|
||||
static zil_stats_t zil_stats = {
|
||||
{ "zil_commit_count", KSTAT_DATA_UINT64 },
|
||||
{ "zil_commit_writer_count", KSTAT_DATA_UINT64 },
|
||||
{ "zil_itx_count", KSTAT_DATA_UINT64 },
|
||||
@@ -123,14 +123,14 @@ int zil_replay_disable = 0;
|
||||
* will cause ZIL corruption on power loss if a volatile out-of-order
|
||||
* write cache is enabled.
|
||||
*/
|
||||
int zil_nocacheflush = 0;
|
||||
static int zil_nocacheflush = 0;
|
||||
|
||||
/*
|
||||
* Limit SLOG write size per commit executed with synchronous priority.
|
||||
* Any writes above that will be executed with lower (asynchronous) priority
|
||||
* to limit potential SLOG device abuse by single active ZIL writer.
|
||||
*/
|
||||
unsigned long zil_slog_bulk = 768 * 1024;
|
||||
static unsigned long zil_slog_bulk = 768 * 1024;
|
||||
|
||||
static kmem_cache_t *zil_lwb_cache;
|
||||
static kmem_cache_t *zil_zcw_cache;
|
||||
@@ -1451,7 +1451,7 @@ zil_lwb_write_open(zilog_t *zilog, lwb_t *lwb)
|
||||
* aligned to 4KB) actually gets written. However, we can't always just
|
||||
* allocate SPA_OLD_MAXBLOCKSIZE as the slog space could be exhausted.
|
||||
*/
|
||||
struct {
|
||||
static const struct {
|
||||
uint64_t limit;
|
||||
uint64_t blksz;
|
||||
} zil_block_buckets[] = {
|
||||
@@ -1469,7 +1469,7 @@ struct {
|
||||
* initialized. Otherwise this should not be used directly; see
|
||||
* zl_max_block_size instead.
|
||||
*/
|
||||
int zil_maxblocksize = SPA_OLD_MAXBLOCKSIZE;
|
||||
static int zil_maxblocksize = SPA_OLD_MAXBLOCKSIZE;
|
||||
|
||||
/*
|
||||
* Start a log block write and advance to the next log block.
|
||||
@@ -3509,7 +3509,7 @@ zil_resume(void *cookie)
|
||||
}
|
||||
|
||||
typedef struct zil_replay_arg {
|
||||
zil_replay_func_t **zr_replay;
|
||||
zil_replay_func_t *const *zr_replay;
|
||||
void *zr_arg;
|
||||
boolean_t zr_byteswap;
|
||||
char *zr_lr;
|
||||
@@ -3630,7 +3630,8 @@ zil_incr_blks(zilog_t *zilog, const blkptr_t *bp, void *arg, uint64_t claim_txg)
|
||||
* If this dataset has a non-empty intent log, replay it and destroy it.
|
||||
*/
|
||||
void
|
||||
zil_replay(objset_t *os, void *arg, zil_replay_func_t *replay_func[TX_MAX_TYPE])
|
||||
zil_replay(objset_t *os, void *arg,
|
||||
zil_replay_func_t *const replay_func[TX_MAX_TYPE])
|
||||
{
|
||||
zilog_t *zilog = dmu_objset_zil(os);
|
||||
const zil_header_t *zh = zilog->zl_header;
|
||||
|
||||
+12
-12
@@ -57,7 +57,7 @@
|
||||
* I/O type descriptions
|
||||
* ==========================================================================
|
||||
*/
|
||||
const char *zio_type_name[ZIO_TYPES] = {
|
||||
const char *const zio_type_name[ZIO_TYPES] = {
|
||||
/*
|
||||
* Note: Linux kernel thread name length is limited
|
||||
* so these names will differ from upstream open zfs.
|
||||
@@ -66,24 +66,24 @@ const char *zio_type_name[ZIO_TYPES] = {
|
||||
};
|
||||
|
||||
int zio_dva_throttle_enabled = B_TRUE;
|
||||
int zio_deadman_log_all = B_FALSE;
|
||||
static int zio_deadman_log_all = B_FALSE;
|
||||
|
||||
/*
|
||||
* ==========================================================================
|
||||
* I/O kmem caches
|
||||
* ==========================================================================
|
||||
*/
|
||||
kmem_cache_t *zio_cache;
|
||||
kmem_cache_t *zio_link_cache;
|
||||
static kmem_cache_t *zio_cache;
|
||||
static kmem_cache_t *zio_link_cache;
|
||||
kmem_cache_t *zio_buf_cache[SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT];
|
||||
kmem_cache_t *zio_data_buf_cache[SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT];
|
||||
#if defined(ZFS_DEBUG) && !defined(_KERNEL)
|
||||
uint64_t zio_buf_cache_allocs[SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT];
|
||||
uint64_t zio_buf_cache_frees[SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT];
|
||||
static uint64_t zio_buf_cache_allocs[SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT];
|
||||
static uint64_t zio_buf_cache_frees[SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT];
|
||||
#endif
|
||||
|
||||
/* Mark IOs as "slow" if they take longer than 30 seconds */
|
||||
int zio_slow_io_ms = (30 * MILLISEC);
|
||||
static int zio_slow_io_ms = (30 * MILLISEC);
|
||||
|
||||
#define BP_SPANB(indblkshift, level) \
|
||||
(((uint64_t)1) << ((level) * ((indblkshift) - SPA_BLKPTRSHIFT)))
|
||||
@@ -115,8 +115,8 @@ int zio_slow_io_ms = (30 * MILLISEC);
|
||||
* and may need to load new metaslabs to satisfy 128K allocations.
|
||||
*/
|
||||
int zfs_sync_pass_deferred_free = 2; /* defer frees starting in this pass */
|
||||
int zfs_sync_pass_dont_compress = 8; /* don't compress starting in this pass */
|
||||
int zfs_sync_pass_rewrite = 2; /* rewrite new bps starting in this pass */
|
||||
static int zfs_sync_pass_dont_compress = 8; /* don't compress s. i. t. p. */
|
||||
static int zfs_sync_pass_rewrite = 2; /* rewrite new bps s. i. t. p. */
|
||||
|
||||
/*
|
||||
* An allocating zio is one that either currently has the DVA allocate
|
||||
@@ -129,12 +129,12 @@ int zfs_sync_pass_rewrite = 2; /* rewrite new bps starting in this pass */
|
||||
* allocations as well.
|
||||
*/
|
||||
int zio_exclude_metadata = 0;
|
||||
int zio_requeue_io_start_cut_in_line = 1;
|
||||
static int zio_requeue_io_start_cut_in_line = 1;
|
||||
|
||||
#ifdef ZFS_DEBUG
|
||||
int zio_buf_debug_limit = 16384;
|
||||
static const int zio_buf_debug_limit = 16384;
|
||||
#else
|
||||
int zio_buf_debug_limit = 0;
|
||||
static const int zio_buf_debug_limit = 0;
|
||||
#endif
|
||||
|
||||
static inline void __zio_execute(zio_t *zio);
|
||||
|
||||
+5
-4
@@ -90,9 +90,9 @@ unsigned int zvol_inhibit_dev = 0;
|
||||
unsigned int zvol_volmode = ZFS_VOLMODE_GEOM;
|
||||
|
||||
struct hlist_head *zvol_htable;
|
||||
list_t zvol_state_list;
|
||||
static list_t zvol_state_list;
|
||||
krwlock_t zvol_state_lock;
|
||||
const zvol_platform_ops_t *ops;
|
||||
static const zvol_platform_ops_t *ops;
|
||||
|
||||
typedef enum {
|
||||
ZVOL_ASYNC_REMOVE_MINORS,
|
||||
@@ -486,6 +486,7 @@ zvol_replay_write(void *arg1, void *arg2, boolean_t byteswap)
|
||||
static int
|
||||
zvol_replay_err(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
(void) arg1, (void) arg2, (void) byteswap;
|
||||
return (SET_ERROR(ENOTSUP));
|
||||
}
|
||||
|
||||
@@ -493,7 +494,7 @@ zvol_replay_err(void *arg1, void *arg2, boolean_t byteswap)
|
||||
* Callback vectors for replaying records.
|
||||
* Only TX_WRITE and TX_TRUNCATE are needed for zvol.
|
||||
*/
|
||||
zil_replay_func_t *zvol_replay_vector[TX_MAX_TYPE] = {
|
||||
zil_replay_func_t *const zvol_replay_vector[TX_MAX_TYPE] = {
|
||||
zvol_replay_err, /* no such transaction type */
|
||||
zvol_replay_err, /* TX_CREATE */
|
||||
zvol_replay_err, /* TX_MKDIR */
|
||||
@@ -521,7 +522,7 @@ zil_replay_func_t *zvol_replay_vector[TX_MAX_TYPE] = {
|
||||
* We store data in the log buffers if it's small enough.
|
||||
* Otherwise we will later flush the data out via dmu_sync().
|
||||
*/
|
||||
ssize_t zvol_immediate_write_sz = 32768;
|
||||
static const ssize_t zvol_immediate_write_sz = 32768;
|
||||
|
||||
void
|
||||
zvol_log_write(zvol_state_t *zv, dmu_tx_t *tx, uint64_t offset,
|
||||
|
||||
Reference in New Issue
Block a user