Changeset cfff7a8f in mainline


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

Fix a little bug when reading inodes from disk

File:
1 edited

Legend:

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

    rdf22c36 rcfff7a8f  
    1111        block_t *b;
    1212        int i;
    13 
     13       
     14        const int ino_off = inum % V1_INODES_PER_BLOCK;
    1415        const size_t ino_size = sizeof(struct mfs_inode);
    1516
     
    2425                        BLOCK_FLAGS_NONE);
    2526
    26         memcpy(ino, ((uint8_t *) b->data) + inum * ino_size, ino_size);
     27        memcpy(ino, ((uint8_t *) b->data) + ino_off * ino_size, ino_size);
    2728
    2829        ino->i_mode = conv16(sbi->native, ino->i_mode);
     
    5960        sbi = instance->sbi;
    6061
     62        const int ino_off = inum % V3_INODES_PER_BLOCK(sbi->block_size);
     63
    6164        block_get(&b, instance->handle,
    6265                        2 + inum / V3_INODES_PER_BLOCK(sbi->block_size),
    6366                        BLOCK_FLAGS_NONE);
    6467
    65         memcpy(ino, ((uint8_t *)b->data) + inum * ino_size, ino_size);
     68        memcpy(ino, ((uint8_t *)b->data) + ino_off * ino_size, ino_size);
    6669
    6770        ino->i_mode = conv16(sbi->native, ino->i_mode);
Note: See TracChangeset for help on using the changeset viewer.