Changeset 1e65444 in mainline for uspace/srv/fs/ext4fs/ext4fs_ops.c


Ignore:
Timestamp:
2011-11-09T17:52:33Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2b9e142
Parents:
35f48f2
Message:

more functional file writing - indirect blocks too

File:
1 edited

Legend:

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

    r35f48f2 r1e65444  
    926926    size_t *wbytes, aoff64_t *nsize)
    927927{
    928         EXT4FS_DBG("");
    929 
    930928        int rc;
    931929        int flags = BLOCK_FLAGS_NONE;
     
    966964        }
    967965
    968         EXT4FS_DBG("bytes == \%u", bytes);
     966//      EXT4FS_DBG("bytes == \%u", bytes);
    969967
    970968        iblock =  pos / block_size;
     
    973971
    974972        if (fblock == 0) {
    975                 EXT4FS_DBG("Allocate block !!!");
     973//              EXT4FS_DBG("Allocate block !!!");
    976974                rc =  ext4_bitmap_alloc_block(fs, inode_ref, &fblock);
    977975                if (rc != EOK) {
     
    981979                }
    982980
    983                 ext4_filesystem_set_inode_data_block_index(fs, inode_ref->inode, iblock, fblock);
     981                ext4_filesystem_set_inode_data_block_index(fs, inode_ref, iblock, fblock);
    984982                inode_ref->dirty = true;
    985983
    986984                flags = BLOCK_FLAGS_NOREAD;
    987985
    988                 EXT4FS_DBG("block \%u allocated", fblock);
     986//              EXT4FS_DBG("block \%u allocated", fblock);
    989987        }
    990988
     
    996994        }
    997995
    998         EXT4FS_DBG("block loaded");
    999 
    1000996        if (flags == BLOCK_FLAGS_NOREAD) {
    1001                 EXT4FS_DBG("fill block with zeros");
     997//              EXT4FS_DBG("fill block with zeros");
    1002998                memset(write_block->data, 0, block_size);
    1003999        }
     
    10051001        rc = async_data_write_finalize(callid, write_block->data + (pos % block_size), bytes);
    10061002        if (rc != EOK) {
     1003                // TODO error
    10071004                EXT4FS_DBG("error in write finalize \%d", rc);
    10081005        }
    10091006
    1010         char *data = write_block->data + (pos % block_size);
    1011         for (uint32_t x = 0; x < bytes; ++x) {
    1012                 printf("%c", data[x]);
    1013         }
    1014         printf("\n");
    1015 
    10161007        write_block->dirty = true;
    10171008
     
    10221013        }
    10231014
    1024         EXT4FS_DBG("writing finished");
     1015//      EXT4FS_DBG("writing finished");
    10251016
    10261017        old_inode_size = ext4_inode_get_size(fs->superblock, inode_ref->inode);
Note: See TracChangeset for help on using the changeset viewer.