Subversion Repositories HelenOS

Rev

Rev 2766 | Rev 4463 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2766 Rev 3653
Line 173... Line 173...
173
        node->fs_handle = result->triplet.fs_handle;
173
        node->fs_handle = result->triplet.fs_handle;
174
        node->dev_handle = result->triplet.dev_handle;
174
        node->dev_handle = result->triplet.dev_handle;
175
        node->index = result->triplet.index;
175
        node->index = result->triplet.index;
176
        node->size = result->size;
176
        node->size = result->size;
177
        node->lnkcnt = result->lnkcnt;
177
        node->lnkcnt = result->lnkcnt;
-
 
178
        node->type = result->type;
178
        link_initialize(&node->nh_link);
179
        link_initialize(&node->nh_link);
179
        rwlock_initialize(&node->contents_rwlock);
180
        rwlock_initialize(&node->contents_rwlock);
180
        hash_table_insert(&nodes, key, &node->nh_link);
181
        hash_table_insert(&nodes, key, &node->nh_link);
181
    } else {
182
    } else {
182
        node = hash_table_get_instance(tmp, vfs_node_t, nh_link);  
183
        node = hash_table_get_instance(tmp, vfs_node_t, nh_link);  
-
 
184
        if (node->type == VFS_NODE_UNKNOWN &&
-
 
185
            result->type != VFS_NODE_UNKNOWN) {
-
 
186
            /* Upgrade the node type. */
-
 
187
            node->type = result->type;
-
 
188
        }
183
    }
189
    }
184
 
190
 
185
    assert(node->size == result->size);
191
    assert(node->size == result->size);
186
    assert(node->lnkcnt == result->lnkcnt);
192
    assert(node->lnkcnt == result->lnkcnt);
-
 
193
    assert(node->type == result->type || result->type == VFS_NODE_UNKNOWN);
187
 
194
 
188
    _vfs_node_addref(node);
195
    _vfs_node_addref(node);
189
    futex_up(&nodes_futex);
196
    futex_up(&nodes_futex);
190
 
197
 
191
    return node;
198
    return node;