Changeset 8f54827 in mainline


Ignore:
Timestamp:
2011-08-02T19:10:26Z (13 years ago)
Author:
Oleg Romanenko <romanenko.oleg@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
59c0777
Parents:
f01fea3
Message:

Implement exfat_node_put

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/exfat/exfat_ops.c

    rf01fea3 r8f54827  
    427427int exfat_node_put(fs_node_t *fn)
    428428{
    429         /* TODO */
     429        exfat_node_t *nodep = EXFAT_NODE(fn);
     430        bool destroy = false;
     431
     432        fibril_mutex_lock(&nodep->lock);
     433        if (!--nodep->refcnt) {
     434                if (nodep->idx) {
     435                        fibril_mutex_lock(&ffn_mutex);
     436                        list_append(&nodep->ffn_link, &ffn_head);
     437                        fibril_mutex_unlock(&ffn_mutex);
     438                } else {
     439                        /*
     440                         * The node does not have any index structure associated
     441                         * with itself. This can only mean that we are releasing
     442                         * the node after a failed attempt to allocate the index
     443                         * structure for it.
     444                         */
     445                        destroy = true;
     446                }
     447        }
     448        fibril_mutex_unlock(&nodep->lock);
     449        if (destroy) {
     450                free(nodep->bp);
     451                free(nodep);
     452        }
    430453        return EOK;
    431454}
Note: See TracChangeset for help on using the changeset viewer.