Changeset 37e7dc54 in mainline for uspace/srv/vfs/vfs_register.c


Ignore:
Timestamp:
2007-09-27T15:27:53Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6c117bb
Parents:
bcf23cf
Message:

VFS work.
Modify the protocol so that VFS and FAT (or any other FS) have to share the Path
Lookup Buffer in read-only mode.

File:
1 edited

Legend:

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

    rbcf23cf r37e7dc54  
    4646#include <bool.h>
    4747#include <futex.h>
     48#include <as.h>
    4849#include <libadt/list.h>
    4950#include "vfs.h"
     
    175176                return;
    176177        }
     178
     179        /*
     180         * Allocate and initialize a buffer for the fs_info structure.
     181         */
    177182        fs_info_t *fs_info;
    178 
    179         /*
    180          * Allocate and initialize a buffer for the fs_info structure.
    181          */
    182183        fs_info = (fs_info_t *) malloc(sizeof(fs_info_t));
    183184        if (!fs_info) {
     
    262263        dprintf("Callback connection to FS created.\n");
    263264
     265        /*
     266         * The client will want us to send him the address space area with PLB.
     267         */
     268        callid = async_get_call(&call);
     269        if (IPC_GET_METHOD(call) != IPC_M_AS_AREA_RECV) {
     270                dprintf("Unexpected call, method = %d\n", IPC_GET_METHOD(call));
     271                list_remove(&fs_info->fs_link);
     272                futex_up(&fs_head_futex);
     273                ipc_hangup(fs_info->phone);
     274                free(fs_info);
     275                ipc_answer_fast(callid, EINVAL, 0, 0);
     276                ipc_answer_fast(rid, EINVAL, 0, 0);
     277                return;
     278        }
     279       
     280        /*
     281         * We can only send the client address space area PLB_SIZE bytes long.
     282         */
     283        size = IPC_GET_ARG2(call);
     284        if (size != PLB_SIZE) {
     285                dprintf("Client suggests wrong size of PFB, size = %d\n", size);
     286                list_remove(&fs_info->fs_link);
     287                futex_up(&fs_head_futex);
     288                ipc_hangup(fs_info->phone);
     289                free(fs_info);
     290                ipc_answer_fast(callid, EINVAL, 0, 0);
     291                ipc_answer_fast(rid, EINVAL, 0, 0);
     292                return;
     293               
     294        }
     295
     296        /*
     297         * Commit to read-only sharing the PLB with the client.
     298         */
     299        ipc_answer_fast(callid, EOK, (ipcarg_t) plb,
     300            (ipcarg_t) (AS_AREA_READ | AS_AREA_CACHEABLE));     
     301
     302        dprintf("Sharing PLB.\n");
     303
    264304        futex_up(&fs_head_futex);
    265305
Note: See TracChangeset for help on using the changeset viewer.