Changeset efedee77 in mainline for uspace/srv/vfs/vfs_register.c


Ignore:
Timestamp:
2010-11-02T22:38:46Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
af894a21
Parents:
aab02fb (diff), e06ef614 (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_register.c

    raab02fb refedee77  
    3939#include <ipc/services.h>
    4040#include <async.h>
     41#include <async_rel.h>
    4142#include <fibril.h>
     43#include <fibril_synch.h>
    4244#include <errno.h>
    4345#include <stdio.h>
     
    4648#include <ctype.h>
    4749#include <bool.h>
    48 #include <fibril_synch.h>
    4950#include <adt/list.h>
    5051#include <as.h>
     
    252253int vfs_grab_phone(fs_handle_t handle)
    253254{
     255        link_t *cur;
     256        fs_info_t *fs;
    254257        int phone;
    255258
     
    262265         */
    263266        fibril_mutex_lock(&fs_head_lock);
    264         link_t *cur;
    265         fs_info_t *fs;
    266267        for (cur = fs_head.next; cur != &fs_head; cur = cur->next) {
    267268                fs = list_get_instance(cur, fs_info_t, fs_link);
     
    269270                        fibril_mutex_unlock(&fs_head_lock);
    270271                        fibril_mutex_lock(&fs->phone_lock);
    271                         phone = ipc_connect_me_to(fs->phone, 0, 0, 0);
     272                        phone = async_relation_create(fs->phone);
    272273                        fibril_mutex_unlock(&fs->phone_lock);
    273274
     
    284285 * @param phone         Phone to FS task.
    285286 */
    286 void vfs_release_phone(int phone)
    287 {
    288         /* TODO: implement connection caching */
    289         ipc_hangup(phone);
     287void vfs_release_phone(fs_handle_t handle, int phone)
     288{
     289        link_t *cur;
     290        fs_info_t *fs;
     291
     292        fibril_mutex_lock(&fs_head_lock);
     293        for (cur = fs_head.next; cur != &fs_head; cur = cur->next) {
     294                fs = list_get_instance(cur, fs_info_t, fs_link);
     295                if (fs->fs_handle == handle) {
     296                        fibril_mutex_unlock(&fs_head_lock);
     297                        fibril_mutex_lock(&fs->phone_lock);
     298                        async_relation_destroy(fs->phone, phone);
     299                        fibril_mutex_unlock(&fs->phone_lock);
     300                        return;
     301                }
     302        }
     303        /* should not really get here */
     304        abort();
     305        fibril_mutex_unlock(&fs_head_lock);
    290306}
    291307
Note: See TracChangeset for help on using the changeset viewer.