Ignore:
File:
1 edited

Legend:

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

    r7ae01d5 r48cc66f  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2026 Jiri Svoboda
    33 * Copyright (c) 2011 Martin Decky
    44 * All rights reserved.
     
    298298}
    299299
    300 static bool nodes_key_equal(const void *k, const ht_link_t *item)
     300static bool nodes_key_equal(const void *k, size_t hash, const ht_link_t *item)
    301301{
    302302        cdfs_node_t *node = hash_table_get_inst(item, cdfs_node_t, nh_link);
     
    341341
    342342        ht_link_t *link = hash_table_find(&nodes, &key);
    343         if (link) {
    344                 cdfs_node_t *node =
    345                     hash_table_get_inst(link, cdfs_node_t, nh_link);
    346 
    347                 *rfn = FS_NODE(node);
    348         } else
     343        if (!link) {
    349344                *rfn = NULL;
    350 
     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);
    351350        return EOK;
    352351}
     
    395394        errno_t rc = cdfs_root_get(&rootfn, fs->service_id);
    396395
    397         assert(rc == EOK);
     396        assert(rc == EOK || rc == EBADF);
    398397
    399398        if (!rootfn)
     
    13541353                cdfs_node_t *node = hash_table_get_inst(item, cdfs_node_t, nh_link);
    13551354
    1356                 if (!node->opened) {
     1355                /* Remove closed, but root node is always in memory. */
     1356                if (!node->opened && node->index != 0) {
    13571357                        hash_table_remove_item(&nodes, item);
    13581358
Note: See TracChangeset for help on using the changeset viewer.