(char*)args[1]);
}
+/****** WRITE_STATE ******/
+static char help_write_state[] = "Write state blocks to all devices";
+static struct args args_write_state[] = {
+ TERMINAL_ARG
+};
+static void c_write_state(struct state *st, void **args)
+{
+ if (st->lafs->blocksize == 0)
+ printf("write state: filesystem is not initialised\n");
+ else if (st->lafs->devs == NULL)
+ printf("write state: No devices exist to write to\n");
+ else if (lafs_write_state(st->lafs))
+ printf("write state: Error writing a state block\n");
+ else if (st->verbose)
+ printf("%s state blocks written: seq now %llu\n",
+ (st->lafs->seq & 1) ? "Odd" : "Even",
+ (unsigned long long) st->lafs->seq);
+}
+
/****** STORE ******/
static char help_store[] = "Create a file in the LaFS from an external file";
static struct args args_store[] = {
CMD(reset),
CMD(store),
CMD(write_dev),
+ CMD(write_state),
{ NULL, NULL, NULL, NULL}
};