Changeset 2b9e142 in mainline for uspace/srv/fs/ext4fs/ext4fs_ops.c


Ignore:
Timestamp:
2011-11-10T08:26:02Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b3d7277
Parents:
1e65444
Message:

used library function instead of while for string length

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/ext4fs/ext4fs_ops.c

    r1e65444 r2b9e142  
    4242#include <macros.h>
    4343#include <malloc.h>
     44#include <string.h>
    4445#include <adt/hash_table.h>
    4546#include <ipc/loc.h>
     
    216217        }
    217218
    218         /* Find length of component in bytes
    219          * TODO: check for library function call that does this
    220          */
    221         component_size = 0;
    222         while (*(component+component_size) != 0) {
    223                 component_size++;
    224         }
     219        component_size = strlen(component);
    225220
    226221        if (ext4_superblock_has_feature_compatible(fs->superblock, EXT4_FEATURE_COMPAT_DIR_INDEX) &&
     
    395390int ext4fs_node_open(fs_node_t *fn)
    396391{
    397         // TODO stateless operation
     392        // Stateless operation
    398393        return EOK;
    399394}
     
    882877
    883878        /* Check for sparse file
    884          * If ext2_filesystem_get_inode_data_block_index returned
     879         * If ext4_filesystem_get_inode_data_block_index returned
    885880         * fs_block == 0, it means that the given block is not allocated for the
    886881         * file and we need to return a buffer of zeros
     
    964959        }
    965960
    966 //      EXT4FS_DBG("bytes == \%u", bytes);
    967 
    968961        iblock =  pos / block_size;
    969962
     
    971964
    972965        if (fblock == 0) {
    973 //              EXT4FS_DBG("Allocate block !!!");
    974966                rc =  ext4_bitmap_alloc_block(fs, inode_ref, &fblock);
    975967                if (rc != EOK) {
     
    984976                flags = BLOCK_FLAGS_NOREAD;
    985977
    986 //              EXT4FS_DBG("block \%u allocated", fblock);
    987978        }
    988979
     
    995986
    996987        if (flags == BLOCK_FLAGS_NOREAD) {
    997 //              EXT4FS_DBG("fill block with zeros");
    998988                memset(write_block->data, 0, block_size);
    999989        }
     
    10121002                return rc;
    10131003        }
    1014 
    1015 //      EXT4FS_DBG("writing finished");
    10161004
    10171005        old_inode_size = ext4_inode_get_size(fs->superblock, inode_ref->inode);
     
    11091097static int ext4fs_close(service_id_t service_id, fs_index_t index)
    11101098{
    1111         // TODO
    11121099        return EOK;
    11131100}
     
    11551142/**
    11561143 * @}
    1157  */ 
     1144 */
Note: See TracChangeset for help on using the changeset viewer.