Name refactiring inside file_windows module
[lwext4.git] / fs_test / lwext4_mkfs.c
index aa7e1ef2b294e3574282b071d054daf588337350..781e8dcd340471d168a15877d13e69584fa6315c 100644 (file)
@@ -39,8 +39,8 @@
 
 #include <ext4.h>
 #include <ext4_mkfs.h>
-#include "../blockdev/linux/ext4_filedev.h"
-#include "../blockdev/windows/io_raw.h"
+#include "../blockdev/linux/file_dev.h"
+#include "../blockdev/windows/file_windows.h"
 
 /**@brief   Input stream name.*/
 const char *input_name = NULL;
@@ -56,6 +56,7 @@ static int fs_type = F_SET_EXT4;
 static struct ext4_fs fs;
 static struct ext4_mkfs_info info = {
        .block_size = 1024,
+       .journal = true,
 };
 
 static bool verbose = false;
@@ -74,8 +75,8 @@ Usage:                                                          \n\
 
 static bool open_linux(void)
 {
-       ext4_filedev_filename(input_name);
-       bd = ext4_filedev_get();
+       file_dev_name_set(input_name);
+       bd = file_dev_get();
        if (!bd) {
                printf("open_filedev: fail\n");
                return false;
@@ -86,8 +87,8 @@ static bool open_linux(void)
 static bool open_windows(void)
 {
 #ifdef WIN32
-       ext4_io_raw_filename(input_name);
-       bd = ext4_io_raw_dev_get();
+       file_windows_name_set(input_name);
+       bd = file_windows_dev_get();
        if (!bd) {
                printf("open_winpartition: fail\n");
                return false;
@@ -116,9 +117,10 @@ static bool parse_opt(int argc, char **argv)
            {"ext", required_argument, 0, 'e'},
            {"wpart", no_argument, 0, 'w'},
            {"verbose", no_argument, 0, 'v'},
+           {"version", no_argument, 0, 'x'},
            {0, 0, 0, 0}};
 
-       while (-1 != (c = getopt_long(argc, argv, "i:b:e:wv",
+       while (-1 != (c = getopt_long(argc, argv, "i:b:e:wvx",
                                      long_options, &option_index))) {
 
                switch (c) {
@@ -137,6 +139,10 @@ static bool parse_opt(int argc, char **argv)
                case 'v':
                        verbose = true;
                        break;
+               case 'x':
+                       puts(VERSION);
+                       exit(0);
+                       break;
                default:
                        printf("%s", usage);
                        return false;