Changeset d510ac01 in mainline for uspace/lib/ext4/libext4_extent.c
- Timestamp:
- 2012-06-23T19:53:49Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 02020dc
- Parents:
- 380553c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_extent.c
r380553c rd510ac01 742 742 uint32_t iblock) 743 743 { 744 EXT4FS_DBG("iblock = \%u", iblock);745 744 746 745 int rc; … … 968 967 */ 969 968 int ext4_extent_append_block(ext4_inode_ref_t *inode_ref, 970 uint32_t *iblock, uint32_t *fblock )969 uint32_t *iblock, uint32_t *fblock, bool update_size) 971 970 { 972 971 int rc = EOK; … … 1026 1025 1027 1026 /* Update i-node */ 1028 ext4_inode_set_size(inode_ref->inode, inode_size + block_size); 1029 inode_ref->dirty = true; 1027 if (update_size) { 1028 ext4_inode_set_size(inode_ref->inode, inode_size + block_size); 1029 inode_ref->dirty = true; 1030 } 1030 1031 1031 1032 path_ptr->block->dirty = true; … … 1056 1057 1057 1058 /* Update i-node */ 1058 ext4_inode_set_size(inode_ref->inode, inode_size + block_size); 1059 inode_ref->dirty = true; 1059 if (update_size) { 1060 ext4_inode_set_size(inode_ref->inode, inode_size + block_size); 1061 inode_ref->dirty = true; 1062 } 1060 1063 1061 1064 path_ptr->block->dirty = true; … … 1067 1070 /* Append new extent to the tree */ 1068 1071 append_extent: 1069 1070 /* Append extent for new block (includes tree splitting if needed) */1071 rc = ext4_extent_append_extent(inode_ref, path, &path_ptr, new_block_idx);1072 if (rc != EOK) {1073 goto finish;1074 }1075 1072 1076 1073 phys_block = 0; … … 1083 1080 } 1084 1081 1082 /* Append extent for new block (includes tree splitting if needed) */ 1083 rc = ext4_extent_append_extent(inode_ref, path, &path_ptr, new_block_idx); 1084 if (rc != EOK) { 1085 ext4_balloc_free_block(inode_ref, phys_block); 1086 goto finish; 1087 } 1088 1085 1089 /* Initialize newly created extent */ 1086 1090 ext4_extent_set_block_count(path_ptr->extent, 1); … … 1089 1093 1090 1094 /* Update i-node */ 1091 ext4_inode_set_size(inode_ref->inode, inode_size + block_size); 1092 inode_ref->dirty = true; 1095 if (update_size) { 1096 ext4_inode_set_size(inode_ref->inode, inode_size + block_size); 1097 inode_ref->dirty = true; 1098 } 1093 1099 1094 1100 path_ptr->block->dirty = true;
Note:
See TracChangeset
for help on using the changeset viewer.