Changes in uspace/srv/fs/mfs/mfs_dentry.c [f7d6b30:6d4d883] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs_dentry.c
rf7d6b30 r6d4d883 44 44 int 45 45 mfs_read_dentry(struct mfs_node *mnode, 46 46 struct mfs_dentry_info *d_info, unsigned index) 47 47 { 48 48 const struct mfs_instance *inst = mnode->instance; … … 57 57 58 58 if (block == 0) { 59 /* End of the dentries list*/59 /* End of the dentries list */ 60 60 r = EOK; 61 61 goto out_err; … … 79 79 } else { 80 80 const int namelen = longnames ? MFS_L_MAX_NAME_LEN : 81 81 MFS_MAX_NAME_LEN; 82 82 83 83 struct mfs_dentry *d; 84 84 85 85 d = b->data + dentry_off * (longnames ? MFSL_DIRSIZE : 86 86 MFS_DIRSIZE); 87 87 d_info->d_inum = conv16(sbi->native, d->d_inum); 88 88 memcpy(d_info->d_name, d->d_name, namelen); … … 101 101 /**Write a directory entry on disk. 102 102 * 103 * @param d_info 104 * 105 * @return 103 * @param d_info Pointer to the directory entry structure to write on disk. 104 * 105 * @return EOK on success or a negative error code. 106 106 */ 107 107 int … … 178 178 179 179 if (name_len == d_name_len && 180 !bcmp(d_info.d_name, d_name, name_len)) { 180 !bcmp(d_info.d_name, d_name, name_len)) { 181 181 182 d_info.d_inum = 0; 182 183 r = mfs_write_dentry(&d_info); … … 197 198 */ 198 199 int 199 mfs_insert_dentry(struct mfs_node *mnode, const char *d_name, fs_index_t d_inum) 200 mfs_insert_dentry(struct mfs_node *mnode, const char *d_name, 201 fs_index_t d_inum) 200 202 { 201 203 int r; … … 209 211 return ENAMETOOLONG; 210 212 211 /* Search for an empty dentry*/213 /* Search for an empty dentry */ 212 214 unsigned i; 213 215 for (i = 0; i < mnode->ino_i->i_size / sbi->dirsize; ++i) { … … 217 219 218 220 if (d_info.d_inum == 0) { 219 /* This entry is not used*/221 /* This entry is not used */ 220 222 empty_dentry_found = true; 221 223 break; … … 231 233 232 234 if (b == 0) { 233 /* Increase the inode size*/235 /* Increase the inode size */ 234 236 235 237 uint32_t dummy;
Note:
See TracChangeset
for help on using the changeset viewer.