Changeset 88ccd8b8 in mainline
- Timestamp:
- 2011-04-07T21:02:47Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 969d88e
- Parents:
- 7a57269f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/minixfs/mfs_ops.c
r7a57269f r88ccd8b8 57 57 static int mfs_match(fs_node_t **rfn, fs_node_t *pfn, const char *component); 58 58 static int mfs_create_node(fs_node_t **rfn, devmap_handle_t handle, int flags); 59 static int mfs_link(fs_node_t *pfn, fs_node_t *cfn, const char *name); 59 60 60 61 static … … 78 79 .match = mfs_match, 79 80 .create = mfs_create_node, 81 .link = mfs_link, 80 82 .plb_get_char = mfs_plb_get_char, 81 83 .has_children = mfs_has_children, … … 252 254 static int mfs_create_node(fs_node_t **rfn, devmap_handle_t handle, int flags) 253 255 { 256 int r; 257 struct mfs_instance *inst; 258 struct mfs_node *mnode; 259 fs_node_t *fsnode; 260 uint32_t inum; 261 254 262 mfsdebug("create_node()\n"); 255 return ENOTSUP; 263 264 r = mfs_instance_get(handle, &inst); 265 if (r != EOK) 266 return r; 267 268 if (flags & L_DIRECTORY) { 269 /*Not yet supported*/ 270 return ENOTSUP; 271 } 272 273 /*Alloc a new inode*/ 274 r = mfs_alloc_bit(inst, &inum, BMAP_INODE); 275 if (r != EOK) 276 return r; 277 278 struct mfs_ino_info *ino_i; 279 280 ino_i = malloc(sizeof(*ino_i)); 281 if (!ino_i) { 282 r = ENOMEM; 283 goto out_err; 284 } 285 286 mnode = malloc(sizeof(*mnode)); 287 if (!mnode) { 288 r = ENOMEM; 289 goto out_err_1; 290 } 291 292 fsnode = malloc(sizeof(fs_node_t)); 293 if (!fsnode) { 294 r = ENOMEM; 295 goto out_err_2; 296 } 297 298 ino_i->i_mode = S_IFREG; 299 ino_i->i_nlinks = 1; 300 ino_i->i_uid = 0; 301 ino_i->i_gid = 0; 302 ino_i->i_size = 0; 303 ino_i->i_atime = 0; 304 ino_i->i_mtime = 0; 305 ino_i->i_ctime = 0; 306 307 memset(ino_i->i_dzone, 0, sizeof(uint32_t) * V2_NR_DIRECT_ZONES); 308 memset(ino_i->i_izone, 0, sizeof(uint32_t) * V2_NR_INDIRECT_ZONES); 309 310 ino_i->index = inum; 311 ino_i->dirty = true; 312 mnode->ino_i = ino_i; 313 mnode->instance = inst; 314 315 put_inode(mnode); 316 317 fs_node_initialize(fsnode); 318 fsnode->data = mnode; 319 *rfn = fsnode; 320 321 return EOK; 322 323 out_err_2: 324 free(mnode); 325 out_err_1: 326 free(ino_i); 327 out_err: 328 return r; 256 329 } 257 330 … … 454 527 { 455 528 return mfs_reg.plb_ro[pos % PLB_SIZE]; 529 } 530 531 static int mfs_link(fs_node_t *pfn, fs_node_t *cfn, const char *name) 532 { 533 mfsdebug("mfs_link()\n"); 534 return ENOTSUP; 456 535 } 457 536
Note:
See TracChangeset
for help on using the changeset viewer.