Changeset 53eb588 in mainline
- Timestamp:
- 2011-06-23T18:34:19Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d8af1bd
- Parents:
- c955be91
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/minixfs/mfs_ops.c
rc955be91 r53eb588 56 56 static int mfs_create_node(fs_node_t **rfn, devmap_handle_t handle, int flags); 57 57 static int mfs_link(fs_node_t *pfn, fs_node_t *cfn, const char *name); 58 static int mfs_unlink(fs_node_t *, fs_node_t *, const char *name); 58 59 59 60 static int mfs_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle, … … 77 78 .create = mfs_create_node, 78 79 .link = mfs_link, 80 .unlink = mfs_unlink, 79 81 .plb_get_char = mfs_plb_get_char, 80 82 .has_children = mfs_has_children, … … 433 435 static unsigned mfs_lnkcnt_get(fs_node_t *fsnode) 434 436 { 435 unsigned rc;436 437 struct mfs_node *mnode = fsnode->data; 437 438 … … 439 440 assert(mnode->ino_i); 440 441 441 rc = mnode->ino_i->i_nlinks; 442 return rc; 442 return mnode->ino_i->i_nlinks;; 443 443 } 444 444 … … 536 536 exit_error: 537 537 return r; 538 } 539 540 static int 541 mfs_unlink(fs_node_t *pfn, fs_node_t *cfn, const char *name) 542 { 543 struct mfs_node *parent = pfn->data; 544 struct mfs_node *child = cfn->data; 545 bool has_children; 546 int r; 547 548 if (!parent) 549 return EBUSY; 550 551 r = mfs_has_children(&has_children, cfn); 552 on_error(r, return r); 553 if (has_children) 554 return ENOTEMPTY; 555 556 r = remove_dentry(parent, name); 557 on_error(r, return r); 558 559 struct mfs_ino_info *chino = child->ino_i; 560 561 assert(chino->i_nlinks >= 1); 562 --chino->i_nlinks; 563 564 chino->dirty = true; 565 566 return EOK; 538 567 } 539 568
Note:
See TracChangeset
for help on using the changeset viewer.