Changeset b7c62a9 in mainline for uspace/srv/vfs/vfs_ops.c


Ignore:
Timestamp:
2013-07-29T11:44:35Z (11 years ago)
Author:
Jiri Zarevucky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
677745a
Parents:
9e9b168
Message:

Make the server oblivious to the link count. It is just another source of potential problems. Also clean up some confusion with file types and node refcount.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs_ops.c

    r9e9b168 rb7c62a9  
    7979        fs_index_t rindex;
    8080        aoff64_t rsize;
    81         unsigned rlnkcnt;
    8281        async_exch_t *exch;
    8382        sysarg_t rc;
     
    130129                rsize = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG2(answer),
    131130                    IPC_GET_ARG3(answer));
    132                 rlnkcnt = (unsigned) IPC_GET_ARG4(answer);
    133131               
    134132                mr_res.triplet.fs_handle = fs_handle;
     
    136134                mr_res.triplet.index = rindex;
    137135                mr_res.size = rsize;
    138                 mr_res.lnkcnt = rlnkcnt;
    139136                mr_res.type = VFS_NODE_DIRECTORY;
    140137                       
     
    237234                rsize = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG2(answer),
    238235                    IPC_GET_ARG3(answer));
    239                 rlnkcnt = (unsigned) IPC_GET_ARG4(answer);
    240236               
    241237                mr_res.triplet.fs_handle = fs_handle;
     
    243239                mr_res.triplet.index = rindex;
    244240                mr_res.size = rsize;
    245                 mr_res.lnkcnt = rlnkcnt;
    246241                mr_res.type = VFS_NODE_DIRECTORY;
    247242               
     
    668663        file->open_write = false;
    669664       
    670         vfs_node_addref(node);
    671         vfs_node_put(node);
    672665        vfs_file_put(file);
    673666        if (parent) {
     
    858851        size_t bytes = IPC_GET_ARG1(answer);
    859852       
    860         if (file->node->type == VFS_NODE_DIRECTORY)
     853        if (file->node->type == VFS_NODE_DIRECTORY) {
    861854                fibril_rwlock_read_unlock(&namespace_rwlock);
     855        }
    862856       
    863857        /* Unlock the VFS node. */
     
    11201114         * VFS_OUT_DESTROY'ed after the last reference to it is dropped.
    11211115         */
    1122         vfs_node_t *node = vfs_node_get(&lr);
    1123         vfs_node_delref(node);
    1124         vfs_node_put(node);
     1116        vfs_node_put(vfs_node_get(&lr));
    11251117
    11261118exit:
     
    12251217       
    12261218        if (orig_unlinked) {
    1227                 vfs_node_t *node = vfs_node_get(&new_lr_orig);
    1228                 vfs_node_delref(node);
    1229                 vfs_node_put(node);
     1219                vfs_node_put(vfs_node_get(&new_lr_orig));
    12301220        }
    12311221       
Note: See TracChangeset for help on using the changeset viewer.