Changeset 2b5d966 in mainline for uspace/lib/ext4/libext4_filesystem.c


Ignore:
Timestamp:
2015-04-30T21:44:54Z (10 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
df2bce3
Parents:
bf1733d3
Message:

libext4, crypto: add the CRC16-IBM implementation to the crypto library.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/libext4_filesystem.c

    rbf1733d3 r2b5d966  
    4141#include <ipc/vfs.h>
    4242#include <align.h>
     43#include <crypto.h>
    4344#include "libext4.h"
    4445
     
    5455    enum cache_mode cmode)
    5556{
     57        int rc;
    5658        ext4_superblock_t *temp_superblock = NULL;
    5759
     
    5961
    6062        /* Initialize block library (4096 is size of communication channel) */
    61         int rc = block_init(EXCHANGE_SERIALIZE, fs->device, 4096);
     63        rc = block_init(EXCHANGE_SERIALIZE, fs->device, 4096);
    6264        if (rc != EOK)
    6365                goto err;
     
    140142        /* Release memory space for superblock */
    141143        free(fs->superblock);
    142        
     144
    143145        /* Finish work with block library */
    144146        block_cache_fini(fs->device);
     
    532534        /* If checksum not supported, 0 will be returned */
    533535        uint16_t crc = 0;
    534        
     536
    535537        /* Compute the checksum only if the filesystem supports it */
    536538        if (ext4_superblock_has_feature_read_only(sb,
     
    545547               
    546548                /* Initialization */
    547                 crc = crc16(~0, sb->uuid, sizeof(sb->uuid));
     549                crc = crc16_ibm(~0, sb->uuid, sizeof(sb->uuid));
    548550               
    549551                /* Include index of block group */
    550                 crc = crc16(crc, (uint8_t *) &le_group, sizeof(le_group));
     552                crc = crc16_ibm(crc, (uint8_t *) &le_group, sizeof(le_group));
    551553               
    552554                /* Compute crc from the first part (stop before checksum field) */
    553                 crc = crc16(crc, (uint8_t *) bg, offset);
     555                crc = crc16_ibm(crc, (uint8_t *) bg, offset);
    554556               
    555557                /* Skip checksum */
     
    560562                    EXT4_FEATURE_INCOMPAT_64BIT)) &&
    561563                    (offset < ext4_superblock_get_desc_size(sb)))
    562                         crc = crc16(crc, ((uint8_t *) bg) + offset,
     564                        crc = crc16_ibm(crc, ((uint8_t *) bg) + offset,
    563565                            ext4_superblock_get_desc_size(sb) - offset);
    564566        }
Note: See TracChangeset for help on using the changeset viewer.