Changeset 05fb96b in mainline
- Timestamp:
- 2011-09-10T10:58:51Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2f72c67a
- Parents:
- cccc091 (diff), 40a2af3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace/srv/fs/mfs
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs.h
rcccc091 r05fb96b 159 159 160 160 extern int 161 mfs_put_inode _core(struct mfs_node *mnode);161 mfs_put_inode(struct mfs_node *mnode); 162 162 163 163 extern int -
uspace/srv/fs/mfs/mfs_balloc.c
rcccc091 r05fb96b 122 122 block_t *b; 123 123 124 assert(inst != NULL);125 124 sbi = inst->sbi; 126 assert(sbi != NULL);127 125 128 126 if (bid == BMAP_ZONE) { … … 192 190 int r, freebit; 193 191 194 assert(inst != NULL);195 192 sbi = inst->sbi; 196 assert(sbi != NULL);197 193 198 194 if (bid == BMAP_ZONE) { -
uspace/srv/fs/mfs/mfs_dentry.c
rcccc091 r05fb96b 76 76 d_info->d_inum = conv32(sbi->native, d3->d_inum); 77 77 memcpy(d_info->d_name, d3->d_name, MFS3_MAX_NAME_LEN); 78 d_info->d_name[MFS3_MAX_NAME_LEN] = 0; 78 79 } else { 79 80 const int namelen = longnames ? MFS_L_MAX_NAME_LEN : … … 86 87 d_info->d_inum = conv16(sbi->native, d->d_inum); 87 88 memcpy(d_info->d_name, d->d_name, namelen); 89 d_info->d_name[namelen] = 0; 88 90 } 89 91 … … 249 251 d_info.d_inum = d_inum; 250 252 memcpy(d_info.d_name, d_name, name_len); 251 d_info.d_name[name_len] = 0; 253 if (name_len < sbi->max_name_len) 254 d_info.d_name[name_len] = 0; 252 255 253 256 r = mfs_write_dentry(&d_info); -
uspace/srv/fs/mfs/mfs_inode.c
rcccc091 r05fb96b 48 48 struct mfs_ino_info **ino_ptr, uint32_t inum); 49 49 50 50 /**Read a MINIX inode from disk 51 * 52 * @param inst Pointer to the filesystem instance. 53 * @param ino_i Pointer to the generic MINIX inode 54 * where the inode content will be stored. 55 * @param index index of the inode to read. 56 * 57 * @return EOK on success or a negative error code. 58 */ 51 59 int 52 60 mfs_get_inode(struct mfs_instance *inst, struct mfs_ino_info **ino_i, … … 77 85 78 86 sbi = instance->sbi; 79 assert(sbi);80 87 81 88 /*inode 0 does not exist*/ … … 142 149 143 150 sbi = instance->sbi; 144 assert(sbi);145 151 146 152 /*inode 0 does not exist*/ … … 185 191 } 186 192 193 /**Write a MINIX inode on disk (if marked as dirty) 194 * 195 * @param mnode Pointer to the generic MINIX inode in memory. 196 * 197 * @return EOK on success or a negative error code. 198 */ 187 199 int 188 mfs_put_inode _core(struct mfs_node *mnode)200 mfs_put_inode(struct mfs_node *mnode) 189 201 { 190 202 int rc = EOK; 191 192 assert(mnode);193 assert(mnode->ino_i);194 203 195 204 if (!mnode->ino_i->dirty) … … 197 206 198 207 struct mfs_instance *inst = mnode->instance; 199 assert(inst);200 208 struct mfs_sb_info *sbi = inst->sbi; 201 assert(sbi);202 209 203 210 if (sbi->fs_version == MFS_VERSION_V1) … … 299 306 } 300 307 308 /**Reduce the inode size of a given number of bytes 309 * 310 * @param mnode Pointer to the generic MINIX inode in memory. 311 * @param size_shrink Number of bytes that will be subtracted to the inode. 312 * 313 * @return EOK on success or a negative error code. 314 */ 301 315 int 302 316 mfs_inode_shrink(struct mfs_node *mnode, size_t size_shrink) -
uspace/srv/fs/mfs/mfs_ops.c
rcccc091 r05fb96b 468 468 static aoff64_t mfs_size_get(fs_node_t *node) 469 469 { 470 assert(node);471 472 470 const struct mfs_node *mnode = node->data; 473 assert(mnode);474 assert(mnode->ino_i);475 476 471 return mnode->ino_i->i_size; 477 472 } … … 513 508 assert(mnode->instance->open_nodes_cnt > 0); 514 509 mnode->instance->open_nodes_cnt--; 515 rc = mfs_put_inode _core(mnode);510 rc = mfs_put_inode(mnode); 516 511 free(mnode->ino_i); 517 512 free(mnode); … … 535 530 { 536 531 struct mfs_node *mnode = fsnode->data; 537 538 assert(mnode->ino_i);539 532 return mnode->ino_i->index; 540 533 } -
uspace/srv/fs/mfs/mfs_rw.c
rcccc091 r05fb96b 53 53 *bytes, this function returns the on-disk block 54 54 *relative to that position. 55 *Returns zero if the block does not exist. 55 * 56 * @param b Pointer to a 32bit number where the block number will be stored 57 * @param mnode Pointer to a generic MINIX inode in memory. 58 * @param pos Position in file. 59 * 60 * @return EOK on success or a negative error code. 56 61 */ 57 62 int … … 227 232 } 228 233 229 /*Free unused indirect zones*/ 234 /**Free unused indirect zones from a MINIX inode according to it's new size. 235 * 236 * @param mnode Pointer to a generic MINIX inode in memory. 237 * @param new_size The new size of the inode. 238 * 239 * @return EOK on success or a negative error code. 240 */ 230 241 int 231 242 mfs_prune_ind_zones(struct mfs_node *mnode, size_t new_size) … … 239 250 mfs_version_t fs_version = sbi->fs_version; 240 251 252 assert(new_size <= ino_i->i_size); 253 241 254 if (fs_version == MFS_VERSION_V1) { 242 255 nr_direct = V1_NR_DIRECT_ZONES;
Note:
See TracChangeset
for help on using the changeset viewer.