Changeset c955be91 in mainline
- Timestamp:
- 2011-06-23T18:33:59Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 53eb588
- Parents:
- 01accb7
- Location:
- uspace/srv/fs/minixfs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/minixfs/mfs.h
r01accb7 rc955be91 48 48 #define NAME "mfs" 49 49 50 #define DEBUG_MODE50 //#define DEBUG_MODE 51 51 52 52 #define min(a, b) ((a) < (b) ? (a) : (b)) … … 211 211 212 212 extern int 213 remove_dentry(struct mfs_node *mnode, const char *d_name); 214 215 extern int 213 216 insert_dentry(struct mfs_node *mnode, const char *d_name, fs_index_t d_inum); 214 217 -
uspace/srv/fs/minixfs/mfs_dentry.c
r01accb7 rc955be91 141 141 142 142 int 143 remove_dentry(struct mfs_node *mnode, const char *d_name) 144 { 145 struct mfs_sb_info *sbi = mnode->instance->sbi; 146 struct mfs_dentry_info *d_info; 147 int i, r; 148 149 const size_t name_len = str_size(d_name); 150 151 if (name_len > sbi->max_name_len) 152 return ENAMETOOLONG; 153 154 /*Search the directory entry to be removed*/ 155 for (i = 0; ; ++i) { 156 r = read_directory_entry(mnode, &d_info, i); 157 on_error(r, return r); 158 159 if (!d_info) { 160 /*Reached the end of the dentries list*/ 161 break; 162 } 163 164 if (!bcmp(d_info->d_name, d_name, name_len)) { 165 d_info->d_inum = 0; 166 r = write_dentry(d_info); 167 return r; 168 } 169 } 170 171 return ENOENT; 172 } 173 174 int 143 175 insert_dentry(struct mfs_node *mnode, const char *d_name, fs_index_t d_inum) 144 176 { … … 150 182 const size_t name_len = str_size(d_name); 151 183 152 assert(name_len <= sbi->max_name_len); 184 if (name_len > sbi->max_name_len) 185 return ENAMETOOLONG; 153 186 154 187 /*Search for an empty dentry*/
Note:
See TracChangeset
for help on using the changeset viewer.