73 " feature enable [-d desc] <pool> <feature>\n"
74 " add a new enabled feature to the pool\n"
75 " -d <desc> sets the feature's description\n"
76 " feature ref [-md] <pool> <feature>\n"
77 " change the refcount on the given feature\n"
78 " -d decrease instead of increase the refcount\n"
79 " -m add the feature to the label if increasing refcount\n"
80 "\n"
81 " <feature> : should be a feature guid\n");
82 exit(1);
83 }
84
85
86 static void
87 fatal(spa_t *spa, void *tag, const char *fmt, ...)
88 {
89 va_list ap;
90
91 if (spa != NULL) {
92 spa_close(spa, tag);
93 (void) spa_export(g_pool, NULL, B_TRUE, B_FALSE);
94 }
95
96 va_start(ap, fmt);
97 (void) fprintf(stderr, "%s: ", cmdname);
98 (void) vfprintf(stderr, fmt, ap);
99 va_end(ap);
100 (void) fprintf(stderr, "\n");
101
102 exit(1);
103 }
104
105 /* ARGSUSED */
106 static int
107 space_delta_cb(dmu_object_type_t bonustype, void *data,
108 uint64_t *userp, uint64_t *groupp)
109 {
110 /*
111 * Is it a valid type of object to track?
112 */
113 if (bonustype != DMU_OT_ZNODE && bonustype != DMU_OT_SA)
539
540 argc -= optind;
541 argv += optind;
542 optind = 1;
543
544 if (argc == 0) {
545 (void) fprintf(stderr, "error: no command specified\n");
546 usage();
547 }
548
549 subcommand = argv[0];
550
551 if (strcmp(subcommand, "feature") == 0) {
552 rv = zhack_do_feature(argc, argv);
553 } else {
554 (void) fprintf(stderr, "error: unknown subcommand: %s\n",
555 subcommand);
556 usage();
557 }
558
559 if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_FALSE) != 0) {
560 fatal(NULL, FTAG, "pool export failed; "
561 "changes may not be committed to disk\n");
562 }
563
564 libzfs_fini(g_zfs);
565 kernel_fini();
566
567 return (rv);
568 }
|
73 " feature enable [-d desc] <pool> <feature>\n"
74 " add a new enabled feature to the pool\n"
75 " -d <desc> sets the feature's description\n"
76 " feature ref [-md] <pool> <feature>\n"
77 " change the refcount on the given feature\n"
78 " -d decrease instead of increase the refcount\n"
79 " -m add the feature to the label if increasing refcount\n"
80 "\n"
81 " <feature> : should be a feature guid\n");
82 exit(1);
83 }
84
85
86 static void
87 fatal(spa_t *spa, void *tag, const char *fmt, ...)
88 {
89 va_list ap;
90
91 if (spa != NULL) {
92 spa_close(spa, tag);
93 (void) spa_export(g_pool, NULL, B_TRUE, B_FALSE, B_FALSE);
94 }
95
96 va_start(ap, fmt);
97 (void) fprintf(stderr, "%s: ", cmdname);
98 (void) vfprintf(stderr, fmt, ap);
99 va_end(ap);
100 (void) fprintf(stderr, "\n");
101
102 exit(1);
103 }
104
105 /* ARGSUSED */
106 static int
107 space_delta_cb(dmu_object_type_t bonustype, void *data,
108 uint64_t *userp, uint64_t *groupp)
109 {
110 /*
111 * Is it a valid type of object to track?
112 */
113 if (bonustype != DMU_OT_ZNODE && bonustype != DMU_OT_SA)
539
540 argc -= optind;
541 argv += optind;
542 optind = 1;
543
544 if (argc == 0) {
545 (void) fprintf(stderr, "error: no command specified\n");
546 usage();
547 }
548
549 subcommand = argv[0];
550
551 if (strcmp(subcommand, "feature") == 0) {
552 rv = zhack_do_feature(argc, argv);
553 } else {
554 (void) fprintf(stderr, "error: unknown subcommand: %s\n",
555 subcommand);
556 usage();
557 }
558
559 if (!g_readonly &&
560 spa_export(g_pool, NULL, B_TRUE, B_TRUE, B_FALSE) != 0) {
561 fatal(NULL, FTAG, "pool export failed; "
562 "changes may not be committed to disk\n");
563 }
564
565 libzfs_fini(g_zfs);
566 kernel_fini();
567
568 return (rv);
569 }
|