add support for ext4
authorDavid Zeuthen <davidz@redhat.com>
Sun, 22 Feb 2009 21:13:28 +0000 (16:13 -0500)
committerDavid Zeuthen <davidz@redhat.com>
Sun, 22 Feb 2009 21:13:28 +0000 (16:13 -0500)
src/devkit-disks-daemon.c
src/job-change-filesystem-label.c
src/job-mkfs.c

index 17335ed..7e9efef 100644 (file)
@@ -348,6 +348,22 @@ static const DevkitDisksFilesystem known_file_systems[] = {
                 TRUE,           /* supports_online_resize_shrink */
         },
         {
+                "ext4",         /* id */
+                "Linux Ext4",   /* name */
+                TRUE,           /* supports_unix_owners */
+                TRUE,           /* can_mount */
+                TRUE,           /* can_create */
+                16,             /* max_label_len */
+                TRUE,           /* supports_label_rename */
+                TRUE,           /* supports_online_label_rename*/
+                TRUE,           /* supports_fsck */
+                FALSE,          /* supports_online_fsck */
+                TRUE,           /* supports_resize_enlarge */
+                TRUE,           /* supports_online_resize_enlarge */
+                TRUE,           /* supports_resize_shrink */
+                TRUE,           /* supports_online_resize_shrink */
+        },
+        {
                 "xfs",          /* id */
                 "XFS",          /* name */
                 TRUE,           /* supports_unix_owners */
index 9a655a4..67f3b23 100644 (file)
@@ -64,7 +64,7 @@ main (int argc, char **argv)
         fstype = argv[2];
         new_label = g_strdup (argv[3]);
 
-        if (strcmp (fstype, "ext3") == 0) {
+        if (strcmp (fstype, "ext3") == 0 || strcmp (fstype, "ext4") == 0) {
                 if (!validate_and_escape_label (&new_label, 16))
                         goto out;
                 command_line = g_strdup_printf ("e2label %s \"%s\"", device, new_label);
index 858a348..eadf62b 100644 (file)
@@ -128,9 +128,10 @@ main (int argc, char **argv)
                 g_string_append_printf (s, " %s", device);
                 command_line = g_string_free (s, FALSE);
 
-        } else if (strcmp (fstype, "ext3") == 0) {
+        } else if (strcmp (fstype, "ext3") == 0 || strcmp (fstype, "ext4") == 0) {
 
-                s = g_string_new ("mkfs.ext3");
+                s = g_string_new ("mkfs.");
+                g_string_append (s, fstype);
                 for (n = 0; options[n] != NULL; n++) {
                         if (g_str_has_prefix (options[n], "label=")) {
                                 label = strdup (options[n] + sizeof ("label=") - 1);