mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 19:28:53 +03:00
Illumos 4370, 4371
4370 avoid transmitting holes during zfs send 4371 DMU code clean up Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Christopher Siden <christopher.siden@delphix.com> Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Approved by: Garrett D'Amore <garrett@damore.org>a References: https://www.illumos.org/issues/4370 https://www.illumos.org/issues/4371 https://github.com/illumos/illumos-gate/commit/43466aa Ported by: Tim Chase <tim@chase2k.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #2529
This commit is contained in:
committed by
Brian Behlendorf
parent
fa86b5dbb6
commit
b0bc7a84d9
+24
-5
@@ -469,6 +469,7 @@ spa_add(const char *name, nvlist_t *config, const char *altroot)
|
||||
spa_t *spa;
|
||||
spa_config_dirent_t *dp;
|
||||
int t;
|
||||
int i;
|
||||
|
||||
ASSERT(MUTEX_HELD(&spa_namespace_lock));
|
||||
|
||||
@@ -548,6 +549,15 @@ spa_add(const char *name, nvlist_t *config, const char *altroot)
|
||||
|
||||
spa->spa_debug = ((zfs_flags & ZFS_DEBUG_SPA) != 0);
|
||||
|
||||
/*
|
||||
* As a pool is being created, treat all features as disabled by
|
||||
* setting SPA_FEATURE_DISABLED for all entries in the feature
|
||||
* refcount cache.
|
||||
*/
|
||||
for (i = 0; i < SPA_FEATURES; i++) {
|
||||
spa->spa_feat_refcount_cache[i] = SPA_FEATURE_DISABLED;
|
||||
}
|
||||
|
||||
return (spa);
|
||||
}
|
||||
|
||||
@@ -1094,11 +1104,19 @@ spa_vdev_state_exit(spa_t *spa, vdev_t *vd, int error)
|
||||
*/
|
||||
|
||||
void
|
||||
spa_activate_mos_feature(spa_t *spa, const char *feature)
|
||||
spa_activate_mos_feature(spa_t *spa, const char *feature, dmu_tx_t *tx)
|
||||
{
|
||||
if (!nvlist_exists(spa->spa_label_features, feature)) {
|
||||
fnvlist_add_boolean(spa->spa_label_features, feature);
|
||||
vdev_config_dirty(spa->spa_root_vdev);
|
||||
/*
|
||||
* When we are creating the pool (tx_txg==TXG_INITIAL), we can't
|
||||
* dirty the vdev config because lock SCL_CONFIG is not held.
|
||||
* Thankfully, in this case we don't need to dirty the config
|
||||
* because it will be written out anyway when we finish
|
||||
* creating the pool.
|
||||
*/
|
||||
if (tx->tx_txg != TXG_INITIAL)
|
||||
vdev_config_dirty(spa->spa_root_vdev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1257,7 +1275,7 @@ spa_generate_guid(spa_t *spa)
|
||||
}
|
||||
|
||||
void
|
||||
sprintf_blkptr(char *buf, const blkptr_t *bp)
|
||||
snprintf_blkptr(char *buf, size_t buflen, const blkptr_t *bp)
|
||||
{
|
||||
char type[256];
|
||||
char *checksum = NULL;
|
||||
@@ -1279,7 +1297,8 @@ sprintf_blkptr(char *buf, const blkptr_t *bp)
|
||||
compress = zio_compress_table[BP_GET_COMPRESS(bp)].ci_name;
|
||||
}
|
||||
|
||||
SPRINTF_BLKPTR(snprintf, ' ', buf, bp, type, checksum, compress);
|
||||
SNPRINTF_BLKPTR(snprintf, ' ', buf, buflen, bp, type, checksum,
|
||||
compress);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1875,7 +1894,7 @@ EXPORT_SYMBOL(spa_strdup);
|
||||
EXPORT_SYMBOL(spa_strfree);
|
||||
EXPORT_SYMBOL(spa_get_random);
|
||||
EXPORT_SYMBOL(spa_generate_guid);
|
||||
EXPORT_SYMBOL(sprintf_blkptr);
|
||||
EXPORT_SYMBOL(snprintf_blkptr);
|
||||
EXPORT_SYMBOL(spa_freeze);
|
||||
EXPORT_SYMBOL(spa_upgrade);
|
||||
EXPORT_SYMBOL(spa_evict_all);
|
||||
|
||||
Reference in New Issue
Block a user