Changeset 8b86ed26 in mainline


Ignore:
Timestamp:
2011-03-18T19:44:01Z (14 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
44c0f5b
Parents:
fcce9e1
Message:

the inode table position depends from the zone and inode bitmap size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/minixfs/mfs_inode.c

    rfcce9e1 r8b86ed26  
    11#include <stdlib.h>
     2#include <assert.h>
    23#include <mem.h>
    34#include "mfs.h"
     
    2122
    2223        sbi = instance->sbi;
     24        assert(sbi);
    2325
    24         block_get(&b, instance->handle, 2 + inum / V1_INODES_PER_BLOCK,
     26        const int itable_off = 2 + sbi->ibmap_blocks + sbi->zbmap_blocks;
     27
     28        block_get(&b, instance->handle, itable_off + inum / V1_INODES_PER_BLOCK,
    2529                        BLOCK_FLAGS_NONE);
    2630
     
    5963
    6064        sbi = instance->sbi;
     65        assert(sbi);
    6166
     67        const int itable_off = 2 + sbi->ibmap_blocks + sbi->zbmap_blocks;
    6268        const int ino_off = inum % V3_INODES_PER_BLOCK(sbi->block_size);
    6369
    6470        block_get(&b, instance->handle,
    65                         2 + inum / V3_INODES_PER_BLOCK(sbi->block_size),
    66                         BLOCK_FLAGS_NONE);
     71                itable_off + inum / V3_INODES_PER_BLOCK(sbi->block_size),
     72                BLOCK_FLAGS_NONE);
    6773
    6874        memcpy(ino, ((uint8_t *)b->data) + ino_off * ino_size, ino_size);
Note: See TracChangeset for help on using the changeset viewer.