Changeset 939b7d2 in mainline
- Timestamp:
- 2011-03-05T11:44:59Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 82650385
- Parents:
- 19a057f9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkminix/mkminix.c
r19a057f9 r939b7d2 60 60 61 61 typedef struct mfs_params { 62 mfs_version_t fs_version;62 uint16_t fs_magic; 63 63 uint32_t block_size; 64 64 size_t devblock_size; … … 96 96 97 97 /*Default is MinixFS V3*/ 98 opt.fs_ version = MFS_VERSION_V3;98 opt.fs_magic = MFS_MAGIC_V3; 99 99 100 100 /*Default block size is 4Kb*/ … … 116 116 exit(0); 117 117 case '1': 118 opt.fs_ version = MFS_VERSION_V1;118 opt.fs_magic = MFS_MAGIC_V1; 119 119 opt.block_size = MFS_MIN_BLOCK_SIZE; 120 120 break; 121 121 case '2': 122 opt.fs_ version = MFS_VERSION_V2;122 opt.fs_magic = MFS_MAGIC_V2; 123 123 opt.block_size = MFS_MIN_BLOCK_SIZE; 124 124 break; 125 125 case '3': 126 opt.fs_ version = MFS_VERSION_V3;126 opt.fs_magic = MFS_MAGIC_V3; 127 127 break; 128 128 case 'b': … … 147 147 exit(0); 148 148 } else if (opt.block_size > MFS_MIN_BLOCK_SIZE && 149 opt.fs_ version != MFS_VERSION_V3) {149 opt.fs_magic != MFS_MAGIC_V3) { 150 150 printf(NAME ":Error! Block size > 1024 is supported by V3 filesystem only.\n"); 151 151 exit(0); 152 } else if (opt.fs_ version == MFS_VERSION_V3 && opt.fs_longnames) {152 } else if (opt.fs_magic == MFS_MAGIC_V3 && opt.fs_longnames) { 153 153 printf(NAME ":Error! Long filenames are supported by V1/V2 filesystem only.\n"); 154 154 exit(0); … … 199 199 /*Prepare superblock*/ 200 200 201 if (opt.fs_ version == MFS_VERSION_V3) {201 if (opt.fs_magic == MFS_MAGIC_V3) { 202 202 sb3 = (struct mfs3_superblock *) malloc(sizeof(struct mfs3_superblock)); 203 203 if (!sb3) { … … 220 220 static void prepare_superblock(struct mfs_superblock *sb, mfs_params_t *opt) 221 221 { 222 switch (opt->fs_version) { 223 case MFS_VERSION_V1L: 224 sb->s_magic = MFS_MAGIC_V1L; 225 break; 226 case MFS_VERSION_V1: 227 sb->s_magic = MFS_MAGIC_V1; 228 break; 229 case MFS_VERSION_V2: 230 sb->s_magic = MFS_MAGIC_V2; 231 break; 232 case MFS_VERSION_V2L: 233 sb->s_magic = MFS_MAGIC_V2L; 234 break; 235 default: 236 break; 237 } 222 if (opt->fs_longnames) { 223 if (opt->fs_magic == MFS_MAGIC_V1) 224 opt->fs_magic = MFS_MAGIC_V1L; 225 else 226 opt->fs_magic = MFS_MAGIC_V2L; 227 } 228 229 sb->s_magic = opt->fs_magic; 238 230 239 231 /*Valid only for MFS V1*/
Note:
See TracChangeset
for help on using the changeset viewer.