Changeset 12b4a7f in mainline for uspace/srv/fs/ext4fs/ext4fs_ops.c
- Timestamp:
- 2011-11-07T16:23:30Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 43a9968
- Parents:
- 052e82d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/ext4fs/ext4fs_ops.c
r052e82d r12b4a7f 954 954 fs = enode->instance->filesystem; 955 955 956 957 if (! ext4_inode_can_truncate(inode_ref->inode)) { 958 // Unable to truncate 959 return EINVAL; 960 } 961 956 962 old_size = ext4_inode_get_size(fs->superblock, inode_ref->inode); 957 958 printf("old size = \%llu, new size = \%llu\n", old_size, new_size);959 963 960 964 if (old_size == new_size) { … … 962 966 } else { 963 967 964 //int rc;965 968 uint32_t block_size; 966 969 uint32_t blocks_count, total_blocks; … … 970 973 971 974 if (old_size < new_size) { 972 // TODO don't return immediately 973 EXT4FS_DBG("expand the file"); 975 // Currently not supported to expand the file 976 // TODO 977 EXT4FS_DBG("trying to expand the file"); 974 978 return EINVAL; 975 979 } 976 977 EXT4FS_DBG("cut the end of the file !");978 980 979 981 size_diff = old_size - new_size; … … 990 992 inode_ref->dirty = true; 991 993 992 for (i = 0; i< blocks_count; ++i) { 994 // starting from 1 because of logical blocks are numbered from 0 995 for (i = 1; i <= blocks_count; ++i) { 993 996 // TODO check retval 997 // TODO decrement inode->blocks_count 998 994 999 ext4_filesystem_release_inode_block(fs, inode_ref, total_blocks - i); 995 1000 }
Note:
See TracChangeset
for help on using the changeset viewer.