Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/ext2fs/ext2fs_ops.c

    rf6fece9 r1a86c50  
    245245        }
    246246
    247         // Find length of component in bytes
    248         // TODO: check for library function call that does this
     247        /* Find length of component in bytes
     248         * TODO: check for library function call that does this
     249         */
    249250        component_size = 0;
    250251        while (*(component+component_size) != 0) {
     
    253254       
    254255        while (it.current != NULL) {
    255                 // ignore empty directory entries
     256                /* ignore empty directory entries */
    256257                if (it.current->inode != 0) {
    257258                        name_size = ext2_directory_entry_ll_get_name_length(fs->superblock,
     
    481482        }
    482483       
    483         // Find a non-empty directory entry
     484        /* Find a non-empty directory entry */
    484485        while (it.current != NULL) {
    485486                if (it.current->inode != 0) {
     
    717718        }
    718719       
    719         // Remove the instance from list
     720        /* Remove the instance from the list */
    720721        fibril_mutex_lock(&instance_list_mutex);
    721722        list_remove(&inst->link);
     
    787788        }
    788789        else {
    789                 // Other inode types not supported
     790                /* Other inode types not supported */
    790791                async_answer_0(callid, ENOTSUP);
    791792                async_answer_0(rid, ENOTSUP);
     
    828829        }
    829830       
    830         // Find the index we want to read
    831         // Note that we need to iterate and count as
    832         // the underlying structure is a linked list
    833         // Moreover, we want to skip . and .. entries
    834         // as these are not used in HelenOS
     831        /* Find the index we want to read
     832         * Note that we need to iterate and count as
     833         * the underlying structure is a linked list
     834         * Moreover, we want to skip . and .. entries
     835         * as these are not used in HelenOS
     836         */
    835837        cur = 0;
    836838        while (it.current != NULL) {
     
    842844                        inst->filesystem->superblock, it.current);
    843845               
    844                 // skip . and ..
     846                /* skip . and .. */
    845847                if (ext2fs_is_dots(&it.current->name, name_size)) {
    846848                        goto skip;
    847849                }
    848850               
    849                 // Is this the dir entry we want to read?
     851                /* Is this the dir entry we want to read? */
    850852                if (cur == pos) {
    851                         // The on-disk entry does not contain \0 at the end
    852                         // end of entry name, so we copy it to new buffer
    853                         // and add the \0 at the end
     853                        /* The on-disk entry does not contain \0 at the end
     854                         * end of entry name, so we copy it to new buffer
     855                         * and add the \0 at the end
     856                         */
    854857                        buf = malloc(name_size+1);
    855858                        if (buf == NULL) {
     
    910913       
    911914        if (pos >= file_size) {
    912                 // Read 0 bytes successfully
     915                /* Read 0 bytes successfully */
    913916                async_data_read_finalize(callid, NULL, 0);
    914917                async_answer_1(rid, EOK, 0);
     
    916919        }
    917920       
    918         // For now, we only read data from one block at a time
     921        /* For now, we only read data from one block at a time */
    919922        block_size = ext2_superblock_get_block_size(inst->filesystem->superblock);
    920923        file_block = pos / block_size;
     
    922925        bytes = min(block_size - offset_in_block, size);
    923926       
    924         // Handle end of file
     927        /* Handle end of file */
    925928        if (pos + bytes > file_size) {
    926929                bytes = file_size - pos;
    927930        }
    928931       
     932        /* Get the real block number */
    929933        rc = ext2_filesystem_get_inode_data_block_index(inst->filesystem,
    930934                inode_ref->inode, file_block, &fs_block);
     
    935939        }
    936940       
    937         // Check for sparse file
    938         // If ext2_filesystem_get_inode_data_block_index returned
    939         // fs_block == 0, it means that the given block is not allocated for the
    940         // file and we need to return a buffer of zeros
     941        /* Check for sparse file
     942         * If ext2_filesystem_get_inode_data_block_index returned
     943         * fs_block == 0, it means that the given block is not allocated for the
     944         * file and we need to return a buffer of zeros
     945         */
    941946        if (fs_block == 0) {
    942947                buffer = malloc(bytes);
     
    957962        }
    958963       
    959         // Usual case - we need to read a block from device
     964        /* Usual case - we need to read a block from device */
    960965        rc = block_get(&block, inst->devmap_handle, fs_block, BLOCK_FLAGS_NONE);
    961966        if (rc != EOK) {
Note: See TracChangeset for help on using the changeset viewer.