Deleted Added
full compact
zhack.c (263397) zhack.c (269006)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 6 unchanged lines hidden (view full) ---

15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 6 unchanged lines hidden (view full) ---

15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright (c) 2013 by Delphix. All rights reserved.
23 * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
24 * Copyright (c) 2013 Steven Hartland. All rights reserved.
25 */
26
27/*
28 * zhack is a debugging tool that can write changes to ZFS pool using libzpool
29 * for testing purposes. Altering pools with zhack is unsupported and may
30 * result in corrupted pools.
31 */

--- 325 unchanged lines hidden (view full) ---

357
358 if (zfeature_is_supported(feature.fi_guid))
359 fatal(spa, FTAG, "'%s' is a real feature, will not enable");
360 if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid))
361 fatal(spa, FTAG, "feature already enabled: %s",
362 feature.fi_guid);
363
364 VERIFY0(dsl_sync_task(spa_name(spa), NULL,
24 * Copyright (c) 2013 Steven Hartland. All rights reserved.
25 */
26
27/*
28 * zhack is a debugging tool that can write changes to ZFS pool using libzpool
29 * for testing purposes. Altering pools with zhack is unsupported and may
30 * result in corrupted pools.
31 */

--- 325 unchanged lines hidden (view full) ---

357
358 if (zfeature_is_supported(feature.fi_guid))
359 fatal(spa, FTAG, "'%s' is a real feature, will not enable");
360 if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid))
361 fatal(spa, FTAG, "feature already enabled: %s",
362 feature.fi_guid);
363
364 VERIFY0(dsl_sync_task(spa_name(spa), NULL,
365 zhack_feature_enable_sync, &feature, 5));
365 zhack_feature_enable_sync, &feature, 5, ZFS_SPACE_CHECK_NORMAL));
366
367 spa_close(spa, FTAG);
368
369 free(desc);
370}
371
372static void
373feature_incr_sync(void *arg, dmu_tx_t *tx)

--- 94 unchanged lines hidden (view full) ---

468 if (feature_get_refcount_from_disk(spa, &feature,
469 &count) == 0 && count != 0) {
470 fatal(spa, FTAG, "feature refcount already 0: %s",
471 feature.fi_guid);
472 }
473 }
474
475 VERIFY0(dsl_sync_task(spa_name(spa), NULL,
366
367 spa_close(spa, FTAG);
368
369 free(desc);
370}
371
372static void
373feature_incr_sync(void *arg, dmu_tx_t *tx)

--- 94 unchanged lines hidden (view full) ---

468 if (feature_get_refcount_from_disk(spa, &feature,
469 &count) == 0 && count != 0) {
470 fatal(spa, FTAG, "feature refcount already 0: %s",
471 feature.fi_guid);
472 }
473 }
474
475 VERIFY0(dsl_sync_task(spa_name(spa), NULL,
476 decr ? feature_decr_sync : feature_incr_sync, &feature, 5));
476 decr ? feature_decr_sync : feature_incr_sync, &feature,
477 5, ZFS_SPACE_CHECK_NORMAL));
477
478 spa_close(spa, FTAG);
479}
480
481static int
482zhack_do_feature(int argc, char **argv)
483{
484 char *subcommand;

--- 86 unchanged lines hidden ---
478
479 spa_close(spa, FTAG);
480}
481
482static int
483zhack_do_feature(int argc, char **argv)
484{
485 char *subcommand;

--- 86 unchanged lines hidden ---