void tree_move_link(struct tree_link *parent, struct tree_link *link) { if (parent != link->par) { tree_unlink_link(link); tree_add_link(parent, link); } }
int vfs_del_leaf(node_t *node) { int rc; assert(node); rc = tree_unlink_link(&(node->tree_link)); if (rc) { node_free(node); } return rc; }
bool k_vfs_rmnode(const char *path) { fsnode_t *fsNode; if((fsNode = k_vfs_find_node_by_full_path(path)) == NULL) return false; /* if folder not empty - return false */ /* TODO: remove sub-catalogs later */ if(!list_is_empty(&fsNode->link.children)) return false; tree_unlink_link(&fsNode->link); k_free(fsNode); return true; }