Changes in / [05fb96b:cccc091] in mainline
- Location:
- uspace/srv/fs/mfs
- Files:
-
- 6 edited
-
mfs.h (modified) (1 diff)
-
mfs_balloc.c (modified) (2 diffs)
-
mfs_dentry.c (modified) (3 diffs)
-
mfs_inode.c (modified) (6 diffs)
-
mfs_ops.c (modified) (3 diffs)
-
mfs_rw.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs.h
r05fb96b rcccc091 159 159 160 160 extern int 161 mfs_put_inode (struct mfs_node *mnode);161 mfs_put_inode_core(struct mfs_node *mnode); 162 162 163 163 extern int -
uspace/srv/fs/mfs/mfs_balloc.c
r05fb96b rcccc091 122 122 block_t *b; 123 123 124 assert(inst != NULL); 124 125 sbi = inst->sbi; 126 assert(sbi != NULL); 125 127 126 128 if (bid == BMAP_ZONE) { … … 190 192 int r, freebit; 191 193 194 assert(inst != NULL); 192 195 sbi = inst->sbi; 196 assert(sbi != NULL); 193 197 194 198 if (bid == BMAP_ZONE) { -
uspace/srv/fs/mfs/mfs_dentry.c
r05fb96b rcccc091 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;79 78 } else { 80 79 const int namelen = longnames ? MFS_L_MAX_NAME_LEN : … … 87 86 d_info->d_inum = conv16(sbi->native, d->d_inum); 88 87 memcpy(d_info->d_name, d->d_name, namelen); 89 d_info->d_name[namelen] = 0;90 88 } 91 89 … … 251 249 d_info.d_inum = d_inum; 252 250 memcpy(d_info.d_name, d_name, name_len); 253 if (name_len < sbi->max_name_len) 254 d_info.d_name[name_len] = 0; 251 d_info.d_name[name_len] = 0; 255 252 256 253 r = mfs_write_dentry(&d_info); -
uspace/srv/fs/mfs/mfs_inode.c
r05fb96b rcccc091 48 48 struct mfs_ino_info **ino_ptr, uint32_t inum); 49 49 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 */ 50 59 51 int 60 52 mfs_get_inode(struct mfs_instance *inst, struct mfs_ino_info **ino_i, … … 85 77 86 78 sbi = instance->sbi; 79 assert(sbi); 87 80 88 81 /*inode 0 does not exist*/ … … 149 142 150 143 sbi = instance->sbi; 144 assert(sbi); 151 145 152 146 /*inode 0 does not exist*/ … … 191 185 } 192 186 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 */199 187 int 200 mfs_put_inode (struct mfs_node *mnode)188 mfs_put_inode_core(struct mfs_node *mnode) 201 189 { 202 190 int rc = EOK; 191 192 assert(mnode); 193 assert(mnode->ino_i); 203 194 204 195 if (!mnode->ino_i->dirty) … … 206 197 207 198 struct mfs_instance *inst = mnode->instance; 199 assert(inst); 208 200 struct mfs_sb_info *sbi = inst->sbi; 201 assert(sbi); 209 202 210 203 if (sbi->fs_version == MFS_VERSION_V1) … … 306 299 } 307 300 308 /**Reduce the inode size of a given number of bytes309 *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 */315 301 int 316 302 mfs_inode_shrink(struct mfs_node *mnode, size_t size_shrink) -
uspace/srv/fs/mfs/mfs_ops.c
r05fb96b rcccc091 468 468 static aoff64_t mfs_size_get(fs_node_t *node) 469 469 { 470 assert(node); 471 470 472 const struct mfs_node *mnode = node->data; 473 assert(mnode); 474 assert(mnode->ino_i); 475 471 476 return mnode->ino_i->i_size; 472 477 } … … 508 513 assert(mnode->instance->open_nodes_cnt > 0); 509 514 mnode->instance->open_nodes_cnt--; 510 rc = mfs_put_inode (mnode);515 rc = mfs_put_inode_core(mnode); 511 516 free(mnode->ino_i); 512 517 free(mnode); … … 530 535 { 531 536 struct mfs_node *mnode = fsnode->data; 537 538 assert(mnode->ino_i); 532 539 return mnode->ino_i->index; 533 540 } -
uspace/srv/fs/mfs/mfs_rw.c
r05fb96b rcccc091 53 53 *bytes, this function returns the on-disk block 54 54 *relative to that position. 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. 55 *Returns zero if the block does not exist. 61 56 */ 62 57 int … … 232 227 } 233 228 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 */ 229 /*Free unused indirect zones*/ 241 230 int 242 231 mfs_prune_ind_zones(struct mfs_node *mnode, size_t new_size) … … 250 239 mfs_version_t fs_version = sbi->fs_version; 251 240 252 assert(new_size <= ino_i->i_size);253 254 241 if (fs_version == MFS_VERSION_V1) { 255 242 nr_direct = V1_NR_DIRECT_ZONES;
Note:
See TracChangeset
for help on using the changeset viewer.
