Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/cdfs/cdfs_ops.c

    r48cc66f r5e801dc  
    11/*
    2  * Copyright (c) 2026 Jiri Svoboda
    32 * Copyright (c) 2011 Martin Decky
    43 * All rights reserved.
     
    298297}
    299298
    300 static bool nodes_key_equal(const void *k, size_t hash, const ht_link_t *item)
     299static bool nodes_key_equal(const void *k, const ht_link_t *item)
    301300{
    302301        cdfs_node_t *node = hash_table_get_inst(item, cdfs_node_t, nh_link);
     
    324323
    325324/** Nodes hash table operations */
    326 static const hash_table_ops_t nodes_ops = {
     325static hash_table_ops_t nodes_ops = {
    327326        .hash = nodes_hash,
    328327        .key_hash = nodes_key_hash,
     
    341340
    342341        ht_link_t *link = hash_table_find(&nodes, &key);
    343         if (!link) {
     342        if (link) {
     343                cdfs_node_t *node =
     344                    hash_table_get_inst(link, cdfs_node_t, nh_link);
     345
     346                *rfn = FS_NODE(node);
     347        } else
    344348                *rfn = NULL;
    345                 return EBADF;
    346         }
    347 
    348         cdfs_node_t *node = hash_table_get_inst(link, cdfs_node_t, nh_link);
    349         *rfn = FS_NODE(node);
     349
    350350        return EOK;
    351351}
     
    394394        errno_t rc = cdfs_root_get(&rootfn, fs->service_id);
    395395
    396         assert(rc == EOK || rc == EBADF);
     396        assert(rc == EOK);
    397397
    398398        if (!rootfn)
     
    10931093
    10941094        /* Initialize the block layer */
    1095         errno_t rc = block_init(service_id);
     1095        errno_t rc = block_init(service_id, BLOCK_SIZE);
    10961096        if (rc != EOK)
    10971097                return rc;
     
    11501150{
    11511151        /* Initialize the block layer */
    1152         errno_t rc = block_init(service_id);
     1152        errno_t rc = block_init(service_id, BLOCK_SIZE);
    11531153        if (rc != EOK)
    11541154                return rc;
     
    13531353                cdfs_node_t *node = hash_table_get_inst(item, cdfs_node_t, nh_link);
    13541354
    1355                 /* Remove closed, but root node is always in memory. */
    1356                 if (!node->opened && node->index != 0) {
     1355                if (!node->opened) {
    13571356                        hash_table_remove_item(&nodes, item);
    13581357
Note: See TracChangeset for help on using the changeset viewer.