HAMMER - Implement volume-list command
[dragonfly.git] / sbin / hammer / hammer.c
index c3e02ed..88b51c4 100644 (file)
@@ -416,6 +416,14 @@ main(int ac, char **av)
                        usage(1);
                exit(0);
        }
+       if (strcmp(av[0], "dedup-simulate") == 0) {
+               hammer_cmd_dedup_simulate(av + 1, ac - 1);
+               exit(0);
+       }
+       if (strcmp(av[0], "dedup") == 0) {
+               hammer_cmd_dedup(av + 1, ac - 1);
+               exit(0);
+       }
        if (strcmp(av[0], "version") == 0) {
                hammer_cmd_get_version(av + 1, ac - 1);
                exit(0);
@@ -432,6 +440,10 @@ main(int ac, char **av)
                hammer_cmd_volume_del(av + 1, ac - 1);
                exit(0);
        }
+       if (strcmp(av[0], "volume-list") == 0) {
+               hammer_cmd_volume_list(av + 1, ac - 1);
+               exit(0);
+       }
 
        uuid_name_lookup(&Hammer_FSType, "DragonFly HAMMER", &status);
        if (status != uuid_s_ok) {
@@ -454,11 +466,23 @@ main(int ac, char **av)
                hammer_cmd_show_undo();
                exit(0);
        }
+       if (strcmp(av[0], "recover") == 0) {
+               hammer_parsedevs(blkdevs);
+               if (ac <= 1)
+                       errx(1, "hammer recover required target directory");
+               hammer_cmd_recover(av[1]);
+               exit(0);
+       }
        if (strcmp(av[0], "blockmap") == 0) {
                hammer_parsedevs(blkdevs);
                hammer_cmd_blockmap();
                exit(0);
        }
+       if (strcmp(av[0], "checkmap") == 0) {
+               hammer_parsedevs(blkdevs);
+               hammer_cmd_checkmap();
+               exit(0);
+       }
        usage(1);
        /* not reached */
        return(0);
@@ -523,11 +547,9 @@ usage(int exit_code)
                "       [-f blkdevs] [-i delay] [-t seconds] [-S splitup]\n"
                "       command [argument ...]\n"
                "hammer synctid <filesystem> [quick]\n"
-               "hammer -f blkdevs blockmap\n"
                "hammer bstats [interval]\n"
                "hammer iostats [interval]\n"
                "hammer history[@offset[,len]] <file> ...\n"
-               "hammer -f blkdevs [-qqq] show [lo:objid]\n"
                "hammer namekey1 <path>\n"
                "hammer namekey2 <path>\n"
                "hammer namekey32 <path>\n"
@@ -559,6 +581,7 @@ usage(int exit_code)
                "hammer version-upgrade <filesystem> <version> [force]\n"
                "hammer volume-add <device> <filesystem>\n"
                "hammer volume-del <device> <filesystem>\n"
+               "hammer volume-list <filesystem>\n"
        );
 
        fprintf(stderr, "\nHAMMER utility version 3+ commands:\n");
@@ -578,7 +601,18 @@ usage(int exit_code)
        fprintf(stderr, "\nHAMMER utility version 4+ commands:\n");
 
        fprintf(stderr,
+               "hammer -f blkdevs blockmap\n"
+               "hammer -f blkdevs checkmap\n"
+               "hammer -f blkdevs [-qqq] show [lo:objid]\n"
                "hammer -f blkdevs show-undo\n"
+               "hammer -f blkdevs recover <target_dir>\n"
+       );
+
+       fprintf(stderr, "\nHAMMER utility version 5+ commands:\n");
+
+       fprintf(stderr,
+               "hammer dedup-simulate <filesystem>\n"
+               "hammer dedup <filesystem>\n"
        );
 
        exit(exit_code);