OSDN Git Service

fsimext2.c (set_mkfs_options): Synchronize with EVMS CVS rev
authorTheodore Ts'o <tytso@mit.edu>
Fri, 8 Nov 2002 17:26:37 +0000 (12:26 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 8 Nov 2002 17:26:37 +0000 (12:26 -0500)
1.7 (2002/09/11): Add a hack to force mkfs won't a
blocksize equal to the hardsector size if it is larger
than 512 bytes.

lib/evms/ChangeLog
lib/evms/fsimext2.c

index 307163c..f4c0b32 100644 (file)
@@ -1,5 +1,10 @@
 2002-11-08  Theodore Ts'o  <tytso@mit.edu>
 
+       * fsimext2.c (set_mkfs_options): Synchronize with EVMS CVS rev
+               1.7 (2002/09/11): Add a hack to force mkfs won't a 
+               blocksize equal to the hardsector size if it is larger
+               than 512 bytes.
+
        * fs_ext2.c (fs_expand, fs_shrink): Synchronize with EVMS CVS rev
                1.13 (2002/09/03).  Add better error handling for child
                processes that die unexpectedly.
index a0e7344..27a7f4f 100644 (file)
@@ -172,6 +172,30 @@ void set_mkfs_options( option_array_t * options,
     /* 'quiet' option */
     argv[1] = "-q";
 
+    /* the following is a big hack to make sure that we don't use a block */
+    /* size smaller than hardsector size since this does not work. */
+    /* would be nice if the ext2/3 utilities (mkfs) handled this themselves */
+    /* also, eventually we will implement this as a user option to manually */
+    /* set block size */
+    if (volume->object->geometry.bytes_per_sector != EVMS_VSECTOR_SIZE) {
+           switch (volume->object->geometry.bytes_per_sector) {
+           case 1024:
+                   argv[2] = "-b1024";
+                   opt_count++;
+                   break;
+           case 2048:
+                   argv[2] = "-b2048";
+                   opt_count++;
+                   break;
+           case 4096:
+                   argv[2] = "-b4096";
+                   opt_count++;
+                   break;
+           default:
+                   /* not one we expect, just skip it */
+           }
+    }
+
     for ( i=0; i<options->count; i++ ) {
 
         if ( options->option[i].is_number_based ) {