Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 45f04f8 in mainline for uspace/srv/vfs/vfs_ops.c


Ignore:
Timestamp:
2010-11-18T18:23:43Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
3f0a7971, a7811f17, cb569e6
Parents:
51a268f (diff), c63e70c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge changes that aim to do a better job in differentiating between
dev_handle_t and device_handle_t, respectively, by renaming these types to
devmap_handle_t and devman_handle_t, respectively.

File:
1 edited

Legend:

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

    r51a268f r45f04f8  
    5555
    5656/* Forward declarations of static functions. */
    57 static int vfs_truncate_internal(fs_handle_t, dev_handle_t, fs_index_t, aoff64_t);
     57static int vfs_truncate_internal(fs_handle_t, devmap_handle_t, fs_index_t, aoff64_t);
    5858
    5959/**
     
    6565vfs_pair_t rootfs = {
    6666        .fs_handle = 0,
    67         .dev_handle = 0
     67        .devmap_handle = 0
    6868};
    6969
    70 static void vfs_mount_internal(ipc_callid_t rid, dev_handle_t dev_handle,
     70static void vfs_mount_internal(ipc_callid_t rid, devmap_handle_t devmap_handle,
    7171    fs_handle_t fs_handle, char *mp, char *opts)
    7272{
     
    125125                        phone = vfs_grab_phone(fs_handle);
    126126                        msg = async_send_1(phone, VFS_OUT_MOUNTED,
    127                             (ipcarg_t) dev_handle, &answer);
     127                            (ipcarg_t) devmap_handle, &answer);
    128128                        /* send the mount options */
    129129                        rc = async_data_write_start(phone, (void *)opts,
     
    150150                       
    151151                        mr_res.triplet.fs_handle = fs_handle;
    152                         mr_res.triplet.dev_handle = dev_handle;
     152                        mr_res.triplet.devmap_handle = devmap_handle;
    153153                        mr_res.triplet.index = rindex;
    154154                        mr_res.size = rsize;
     
    157157                       
    158158                        rootfs.fs_handle = fs_handle;
    159                         rootfs.dev_handle = dev_handle;
     159                        rootfs.devmap_handle = devmap_handle;
    160160                       
    161161                        /* Add reference to the mounted root. */
     
    187187        phone = vfs_grab_phone(mp_res.triplet.fs_handle);
    188188        msg = async_send_4(phone, VFS_OUT_MOUNT,
    189             (ipcarg_t) mp_res.triplet.dev_handle,
     189            (ipcarg_t) mp_res.triplet.devmap_handle,
    190190            (ipcarg_t) mp_res.triplet.index,
    191191            (ipcarg_t) fs_handle,
    192             (ipcarg_t) dev_handle, &answer);
     192            (ipcarg_t) devmap_handle, &answer);
    193193       
    194194        /* send connection */
     
    229229       
    230230                mr_res.triplet.fs_handle = fs_handle;
    231                 mr_res.triplet.dev_handle = dev_handle;
     231                mr_res.triplet.devmap_handle = devmap_handle;
    232232                mr_res.triplet.index = rindex;
    233233                mr_res.size = rsize;
     
    255255         * in the request.
    256256         */
    257         dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
     257        devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
    258258       
    259259        /*
     
    343343       
    344344        /* Do the mount */
    345         vfs_mount_internal(rid, dev_handle, fs_handle, mp, opts);
     345        vfs_mount_internal(rid, devmap_handle, fs_handle, mp, opts);
    346346        free(mp);
    347347        free(fs_name);
     
    402402         */
    403403        if (vfs_nodes_refcount_sum_get(mr_node->fs_handle,
    404             mr_node->dev_handle) != 2) {
     404            mr_node->devmap_handle) != 2) {
    405405                fibril_rwlock_write_unlock(&namespace_rwlock);
    406406                vfs_node_put(mr_node);
     
    422422                phone = vfs_grab_phone(mr_node->fs_handle);
    423423                rc = async_req_1_0(phone, VFS_OUT_UNMOUNTED,
    424                     mr_node->dev_handle);
     424                    mr_node->devmap_handle);
    425425                vfs_release_phone(mr_node->fs_handle, phone);
    426426                if (rc != EOK) {
     
    431431                }
    432432                rootfs.fs_handle = 0;
    433                 rootfs.dev_handle = 0;
     433                rootfs.devmap_handle = 0;
    434434        } else {
    435435
     
    458458
    459459                phone = vfs_grab_phone(mp_node->fs_handle);
    460                 rc = async_req_2_0(phone, VFS_OUT_UNMOUNT, mp_node->dev_handle,
     460                rc = async_req_2_0(phone, VFS_OUT_UNMOUNT, mp_node->devmap_handle,
    461461                    mp_node->index);
    462462                vfs_release_phone(mp_node->fs_handle, phone);
     
    569569                if (node->size) {
    570570                        rc = vfs_truncate_internal(node->fs_handle,
    571                             node->dev_handle, node->index, 0);
     571                            node->devmap_handle, node->index, 0);
    572572                        if (rc) {
    573573                                fibril_rwlock_write_unlock(&node->contents_rwlock);
     
    626626       
    627627        lr.triplet.fs_handle = IPC_GET_ARG1(*request);
    628         lr.triplet.dev_handle = IPC_GET_ARG2(*request);
     628        lr.triplet.devmap_handle = IPC_GET_ARG2(*request);
    629629        lr.triplet.index = IPC_GET_ARG3(*request);
    630630        int oflag = IPC_GET_ARG4(*request);
     
    647647                if (node->size) {
    648648                        rc = vfs_truncate_internal(node->fs_handle,
    649                             node->dev_handle, node->index, 0);
     649                            node->devmap_handle, node->index, 0);
    650650                        if (rc) {
    651651                                fibril_rwlock_write_unlock(&node->contents_rwlock);
     
    709709        aid_t msg;
    710710        ipc_call_t answer;
    711         msg = async_send_2(fs_phone, VFS_OUT_SYNC, file->node->dev_handle,
     711        msg = async_send_2(fs_phone, VFS_OUT_SYNC, file->node->devmap_handle,
    712712            file->node->index, &answer);
    713713
     
    740740                aid_t msg;
    741741                ipc_call_t answer;
    742                 msg = async_send_2(fs_phone, VFS_OUT_CLOSE, file->node->dev_handle,
     742                msg = async_send_2(fs_phone, VFS_OUT_CLOSE, file->node->devmap_handle,
    743743                    file->node->index, &answer);
    744744               
     
    838838               
    839839                rc = async_data_read_forward_3_1(fs_phone, VFS_OUT_READ,
    840                     file->node->dev_handle, file->node->index, file->pos,
     840                    file->node->devmap_handle, file->node->index, file->pos,
    841841                    &answer);
    842842        } else {
    843843                rc = async_data_write_forward_3_1(fs_phone, VFS_OUT_WRITE,
    844                     file->node->dev_handle, file->node->index, file->pos,
     844                    file->node->devmap_handle, file->node->index, file->pos,
    845845                    &answer);
    846846        }
     
    961961}
    962962
    963 int vfs_truncate_internal(fs_handle_t fs_handle, dev_handle_t dev_handle,
     963int vfs_truncate_internal(fs_handle_t fs_handle, devmap_handle_t devmap_handle,
    964964    fs_index_t index, aoff64_t size)
    965965{
     
    968968       
    969969        fs_phone = vfs_grab_phone(fs_handle);
    970         rc = async_req_4_0(fs_phone, VFS_OUT_TRUNCATE, (ipcarg_t) dev_handle,
     970        rc = async_req_4_0(fs_phone, VFS_OUT_TRUNCATE, (ipcarg_t) devmap_handle,
    971971            (ipcarg_t) index, LOWER32(size), UPPER32(size));
    972972        vfs_release_phone(fs_handle, fs_phone);
     
    990990        fibril_rwlock_write_lock(&file->node->contents_rwlock);
    991991        rc = vfs_truncate_internal(file->node->fs_handle,
    992             file->node->dev_handle, file->node->index, size);
     992            file->node->devmap_handle, file->node->index, size);
    993993        if (rc == EOK)
    994994                file->node->size = size;
     
    10221022       
    10231023        aid_t msg;
    1024         msg = async_send_3(fs_phone, VFS_OUT_STAT, file->node->dev_handle,
     1024        msg = async_send_3(fs_phone, VFS_OUT_STAT, file->node->devmap_handle,
    10251025            file->node->index, true, NULL);
    10261026        ipc_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
     
    10711071        int fs_phone = vfs_grab_phone(node->fs_handle);
    10721072        aid_t msg;
    1073         msg = async_send_3(fs_phone, VFS_OUT_STAT, node->dev_handle,
     1073        msg = async_send_3(fs_phone, VFS_OUT_STAT, node->devmap_handle,
    10741074            node->index, false, NULL);
    10751075        ipc_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
     
    12451245        /* Check whether linking to the same file system instance. */
    12461246        if ((old_node->fs_handle != new_par_lr.triplet.fs_handle) ||
    1247             (old_node->dev_handle != new_par_lr.triplet.dev_handle)) {
     1247            (old_node->devmap_handle != new_par_lr.triplet.devmap_handle)) {
    12481248                fibril_rwlock_write_unlock(&namespace_rwlock);
    12491249                ipc_answer_0(rid, EXDEV);       /* different file systems */
Note: See TracChangeset for help on using the changeset viewer.