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

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


Ignore:
Timestamp:
2011-08-16T18:53:00Z (10 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master
Children:
49160c4
Parents:
e0e922d (diff), 45058baa (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 mainline changes.

File:
1 edited

Legend:

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

    re0e922d rdb6e419  
    5454
    5555/* Forward declarations of static functions. */
    56 static int vfs_truncate_internal(fs_handle_t, devmap_handle_t, fs_index_t,
     56static int vfs_truncate_internal(fs_handle_t, service_id_t, fs_index_t,
    5757    aoff64_t);
    5858
     
    6565vfs_pair_t rootfs = {
    6666        .fs_handle = 0,
    67         .devmap_handle = 0
     67        .service_id = 0
    6868};
    6969
    70 static void vfs_mount_internal(ipc_callid_t rid, devmap_handle_t devmap_handle,
     70static void vfs_mount_internal(ipc_callid_t rid, service_id_t service_id,
    7171    fs_handle_t fs_handle, char *mp, char *opts)
    7272{
     
    125125                        exch = vfs_exchange_grab(fs_handle);
    126126                        msg = async_send_1(exch, VFS_OUT_MOUNTED,
    127                             (sysarg_t) devmap_handle, &answer);
     127                            (sysarg_t) service_id, &answer);
    128128                        /* Send the mount options */
    129129                        rc = async_data_write_start(exch, (void *)opts,
     
    150150                       
    151151                        mr_res.triplet.fs_handle = fs_handle;
    152                         mr_res.triplet.devmap_handle = devmap_handle;
     152                        mr_res.triplet.service_id = service_id;
    153153                        mr_res.triplet.index = rindex;
    154154                        mr_res.size = rsize;
     
    157157                       
    158158                        rootfs.fs_handle = fs_handle;
    159                         rootfs.devmap_handle = devmap_handle;
     159                        rootfs.service_id = service_id;
    160160                       
    161161                        /* Add reference to the mounted root. */
     
    178178       
    179179        /*
    180          * At this point, we have all necessary pieces: file system and device
    181          * handles, and we know the mount point VFS node.
     180         * At this point, we have all necessary pieces: file system handle
     181         * and service ID, and we know the mount point VFS node.
    182182         */
    183183       
     
    187187        exch = vfs_exchange_grab(mp_res.triplet.fs_handle);
    188188        msg = async_send_4(exch, VFS_OUT_MOUNT,
    189             (sysarg_t) mp_res.triplet.devmap_handle,
     189            (sysarg_t) mp_res.triplet.service_id,
    190190            (sysarg_t) mp_res.triplet.index,
    191191            (sysarg_t) fs_handle,
    192             (sysarg_t) devmap_handle, &answer);
     192            (sysarg_t) service_id, &answer);
    193193       
    194194        /* Send connection */
     
    234234               
    235235                mr_res.triplet.fs_handle = fs_handle;
    236                 mr_res.triplet.devmap_handle = devmap_handle;
     236                mr_res.triplet.service_id = service_id;
    237237                mr_res.triplet.index = rindex;
    238238                mr_res.size = rsize;
     
    255255void vfs_mount(ipc_callid_t rid, ipc_call_t *request)
    256256{
    257         devmap_handle_t devmap_handle;
     257        service_id_t service_id;
    258258
    259259        /*
     
    262262         * in the request.
    263263         */
    264         devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
     264        service_id = (service_id_t) IPC_GET_ARG1(*request);
    265265       
    266266        /*
     
    350350       
    351351        /* Do the mount */
    352         vfs_mount_internal(rid, devmap_handle, fs_handle, mp, opts);
     352        vfs_mount_internal(rid, service_id, fs_handle, mp, opts);
    353353        free(mp);
    354354        free(fs_name);
     
    409409         */
    410410        if (vfs_nodes_refcount_sum_get(mr_node->fs_handle,
    411             mr_node->devmap_handle) != 2) {
     411            mr_node->service_id) != 2) {
    412412                fibril_rwlock_write_unlock(&namespace_rwlock);
    413413                vfs_node_put(mr_node);
     
    430430                exch = vfs_exchange_grab(mr_node->fs_handle);
    431431                rc = async_req_1_0(exch, VFS_OUT_UNMOUNTED,
    432                     mr_node->devmap_handle);
     432                    mr_node->service_id);
    433433                vfs_exchange_release(exch);
    434434               
     
    441441               
    442442                rootfs.fs_handle = 0;
    443                 rootfs.devmap_handle = 0;
     443                rootfs.service_id = 0;
    444444        } else {
    445445               
     
    470470                exch = vfs_exchange_grab(mp_node->fs_handle);
    471471                rc = async_req_2_0(exch, VFS_OUT_UNMOUNT,
    472                     mp_node->devmap_handle, mp_node->index);
     472                    mp_node->service_id, mp_node->index);
    473473                vfs_exchange_release(exch);
    474474               
     
    575575                if (node->size) {
    576576                        rc = vfs_truncate_internal(node->fs_handle,
    577                             node->devmap_handle, node->index, 0);
     577                            node->service_id, node->index, 0);
    578578                        if (rc) {
    579579                                fibril_rwlock_write_unlock(&node->contents_rwlock);
     
    628628       
    629629        lr.triplet.fs_handle = IPC_GET_ARG1(*request);
    630         lr.triplet.devmap_handle = IPC_GET_ARG2(*request);
     630        lr.triplet.service_id = IPC_GET_ARG2(*request);
    631631        lr.triplet.index = IPC_GET_ARG3(*request);
    632632        int oflag = IPC_GET_ARG4(*request);
     
    649649                if (node->size) {
    650650                        rc = vfs_truncate_internal(node->fs_handle,
    651                             node->devmap_handle, node->index, 0);
     651                            node->service_id, node->index, 0);
    652652                        if (rc) {
    653653                                fibril_rwlock_write_unlock(&node->contents_rwlock);
     
    712712        aid_t msg;
    713713        ipc_call_t answer;
    714         msg = async_send_2(fs_exch, VFS_OUT_SYNC, file->node->devmap_handle,
     714        msg = async_send_2(fs_exch, VFS_OUT_SYNC, file->node->service_id,
    715715            file->node->index, &answer);
    716716       
     
    797797        if (read) {
    798798                rc = async_data_read_forward_4_1(fs_exch, VFS_OUT_READ,
    799                     file->node->devmap_handle, file->node->index,
     799                    file->node->service_id, file->node->index,
    800800                    LOWER32(file->pos), UPPER32(file->pos), &answer);
    801801        } else {
     
    804804               
    805805                rc = async_data_write_forward_4_1(fs_exch, VFS_OUT_WRITE,
    806                     file->node->devmap_handle, file->node->index,
     806                    file->node->service_id, file->node->index,
    807807                    LOWER32(file->pos), UPPER32(file->pos), &answer);
    808808        }
     
    935935}
    936936
    937 int vfs_truncate_internal(fs_handle_t fs_handle, devmap_handle_t devmap_handle,
     937int vfs_truncate_internal(fs_handle_t fs_handle, service_id_t service_id,
    938938    fs_index_t index, aoff64_t size)
    939939{
    940940        async_exch_t *exch = vfs_exchange_grab(fs_handle);
    941941        sysarg_t rc = async_req_4_0(exch, VFS_OUT_TRUNCATE,
    942             (sysarg_t) devmap_handle, (sysarg_t) index, LOWER32(size),
     942            (sysarg_t) service_id, (sysarg_t) index, LOWER32(size),
    943943            UPPER32(size));
    944944        vfs_exchange_release(exch);
     
    963963        fibril_rwlock_write_lock(&file->node->contents_rwlock);
    964964        rc = vfs_truncate_internal(file->node->fs_handle,
    965             file->node->devmap_handle, file->node->index, size);
     965            file->node->service_id, file->node->index, size);
    966966        if (rc == EOK)
    967967                file->node->size = size;
     
    997997       
    998998        aid_t msg;
    999         msg = async_send_3(exch, VFS_OUT_STAT, file->node->devmap_handle,
     999        msg = async_send_3(exch, VFS_OUT_STAT, file->node->service_id,
    10001000            file->node->index, true, NULL);
    10011001        async_forward_fast(callid, exch, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
     
    10501050       
    10511051        aid_t msg;
    1052         msg = async_send_3(exch, VFS_OUT_STAT, node->devmap_handle,
     1052        msg = async_send_3(exch, VFS_OUT_STAT, node->service_id,
    10531053            node->index, false, NULL);
    10541054        async_forward_fast(callid, exch, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
     
    12271227        /* Check whether linking to the same file system instance. */
    12281228        if ((old_node->fs_handle != new_par_lr.triplet.fs_handle) ||
    1229             (old_node->devmap_handle != new_par_lr.triplet.devmap_handle)) {
     1229            (old_node->service_id != new_par_lr.triplet.service_id)) {
    12301230                fibril_rwlock_write_unlock(&namespace_rwlock);
    12311231                vfs_node_put(old_node);
Note: See TracChangeset for help on using the changeset viewer.