diff ffstools/tiffs-mkfs/main.c @ 717:178ed445021d

tiffs-mkfs: journal creation implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 23 Aug 2020 03:40:10 +0000
parents 12ae93940467
children
line wrap: on
line diff
--- a/ffstools/tiffs-mkfs/main.c	Wed Jul 01 00:31:37 2020 +0000
+++ b/ffstools/tiffs-mkfs/main.c	Sun Aug 23 03:40:10 2020 +0000
@@ -16,7 +16,7 @@
 	extern char *optarg;
 	int c;
 
-	while ((c = getopt(argc, argv, "c:f:m:")) != EOF)
+	while ((c = getopt(argc, argv, "c:f:j:Jm:")) != EOF)
 		switch (c) {
 		case 'c':
 			chunk_size_max = strtoul(optarg, 0, 0);
@@ -29,6 +29,12 @@
 			}
 			format_name = optarg;
 			continue;
+		case 'j':
+			journal_size = strtoul(optarg, 0, 0);
+			continue;
+		case 'J':
+			no_journal = 1;
+			continue;
 		case 'm':
 			block_files_max = strtoul(optarg, 0, 0);
 			continue;
@@ -52,6 +58,7 @@
 	if (!format_name)
 		format_name = "/";
 	preen_chunk_size_max();
+	preen_journal_size();
 	preen_block_files_max();
 	/* input phase */
 	read_dir_level(&root, input_host_dir, 0);
@@ -61,6 +68,8 @@
 	open_output_file();
 	create_root_dir();
 	process_dir_level(&root);
+	if (!no_journal)
+		create_journal();
 	finish_output();
 	close(output_fd);
 	exit(0);