Changeset 92dd5c8 in mainline
- Timestamp:
- 2011-03-13T20:14:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 245eb02d
- Parents:
- ccbc5b56
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified uspace/app/mkminix/mkminix.c ¶
rccbc5b56 r92dd5c8 58 58 #define UPPER(n, size) (((n) / (size)) + (((n) % (size)) != 0)) 59 59 #define NEXT_DENTRY(p, dirsize) (p += dirsize) 60 #define FIRST_ZONE(bs) ( (MFS_BOOTBLOCK_SIZE + MFS_SUPERBLOCK_SIZE) / (bs))60 #define FIRST_ZONE(bs) (1 + (bs) / MFS_MIN_BLOCKSIZE) 61 61 #define CONVERT_1K_OFF(off, bs) ((off) * ((bs) / MFS_MIN_BLOCKSIZE)) 62 62 … … 329 329 330 330 /*Convert to 1K offset*/ 331 itable_off = CONVERT_1K_OFF(itable_off, sb->block_size) + 2; 331 itable_off = CONVERT_1K_OFF(itable_off, sb->block_size) + 332 FIRST_ZONE(sb->block_size); 332 333 itable_size = CONVERT_1K_OFF(sb->itable_size, sb->block_size); 333 334 … … 392 393 393 394 /*Convert to 1K block offset*/ 394 itable_off = CONVERT_1K_OFF(itable_off, sb->block_size) + 2; 395 itable_off = CONVERT_1K_OFF(itable_off, sb->block_size) + 396 FIRST_ZONE(sb->block_size); 395 397 396 398 const time_t sec = time(NULL); … … 468 470 469 471 /*Compute first data zone position*/ 470 sb->first_data_zone = FIRST_ZONE(sb->block_size)+ sb->itable_size +472 sb->first_data_zone = 2 + sb->itable_size + 471 473 sb->zbmap_blocks + sb->ibmap_blocks; 472 474 … … 582 584 zbmap_buf8 = (uint8_t *) zbmap_buf; 583 585 584 int start_block = 2;586 int start_block = FIRST_ZONE(sb->block_size); 585 587 586 588 for (i = 0; i < ibmap_nblocks; ++i) { … … 590 592 } 591 593 592 start_block = 2+ ibmap_nblocks;594 start_block = FIRST_ZONE(sb->block_size) + ibmap_nblocks; 593 595 594 596 for (i = 0; i < zbmap_nblocks; ++i) { -
TabularUnified uspace/srv/fs/minixfs/mfs.c ¶
rccbc5b56 r92dd5c8 97 97 callid = async_get_call(&call); 98 98 switch (IPC_GET_IMETHOD(call)) { 99 default:100 99 case IPC_M_PHONE_HUNGUP: 101 100 return; 102 101 case VFS_OUT_MOUNTED: 102 mfsdebug("Mount request received\n"); 103 103 mfs_mounted(callid, &call); 104 break; 105 case VFS_OUT_MOUNT: 106 mfsdebug("Mounting...\n"); 107 break; 108 default: 109 async_answer_0(callid, ENOTSUP); 104 110 break; 105 111 } -
TabularUnified uspace/srv/fs/minixfs/mfs.h ¶
rccbc5b56 r92dd5c8 37 37 #include "../../vfs/vfs.h" 38 38 39 #define DEBUG_MODE 40 41 #ifdef DEBUG_MODE 42 #define mfsdebug(...) printf(__VA_ARGS__) 43 #else 44 #define mfsdebug(...) 45 #endif 46 39 47 typedef enum { 40 48 MFS_VERSION_V1 = 1, -
TabularUnified uspace/srv/fs/minixfs/mfs_super.c ¶
rccbc5b56 r92dd5c8 32 32 33 33 #include <libfs.h> 34 #include <stdio.h> 34 35 #include <stdlib.h> 35 36 #include <libblock.h> … … 47 48 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request); 48 49 enum cache_mode cmode; 49 struct mfs 3_superblock *sp;50 struct mfs_superblock *sp; 50 51 bool native, longnames; 51 52 mfs_version_t version; … … 56 57 57 58 if (rc != EOK) { 59 mfsdebug("Can't accept async data write\n"); 58 60 async_answer_0(rid, rc); 59 61 return; … … 69 71 70 72 /* initialize libblock */ 71 rc = block_init(devmap_handle, MFS_SUPERBLOCK_SIZE);73 rc = block_init(devmap_handle, 1024); 72 74 if (rc != EOK) { 75 mfsdebug("libblock initialization failed\n"); 73 76 async_answer_0(rid, rc); 74 77 return; 75 78 } 76 79 77 /* prepare the superblock */ 78 rc = block_bb_read(devmap_handle, MFS_SUPERBLOCK); 80 sp = malloc(MFS_SUPERBLOCK_SIZE); 81 82 /* Read the superblock */ 83 rc = block_read_direct(devmap_handle, MFS_SUPERBLOCK << 1, 1, sp); 79 84 if (rc != EOK) { 80 85 block_fini(devmap_handle); … … 83 88 } 84 89 85 /* get the buffer with the superblock */86 sp = block_bb_get(devmap_handle);87 88 90 if (!check_magic_number(sp->s_magic, &native, &version, &longnames)) { 89 91 /*Magic number is invalid!*/ 92 mfsdebug("magic number not recognized\n"); 90 93 block_fini(devmap_handle); 91 94 async_answer_0(rid, ENOTSUP); 92 95 return; 93 96 } 97 98 mfsdebug("magic number recognized\n"); 99 free(sp); 94 100 } 95 101 … … 98 104 { 99 105 *longfilenames = false; 106 107 mfsdebug("magic = %d\n", magic); 100 108 101 109 if (magic == MFS_MAGIC_V1 || magic == MFS_MAGIC_V1R) {
Note:
See TracChangeset
for help on using the changeset viewer.