Changeset cde485d in mainline for uspace/srv/fs/fat/fat.c


Ignore:
Timestamp:
2008-06-06T20:23:02Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b7b6753
Parents:
f49b0ea
Message:

Initialize global FAT IDX structures when the FAT server starts and initialize
per-file system FAT IDX structures when a file system gets mounted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat.c

    rf49b0ea rcde485d  
    5656                [IPC_METHOD_TO_VFS_OP(VFS_TRUNCATE)] = VFS_OP_NULL,
    5757                [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_NULL,
     58                [IPC_METHOD_TO_VFS_OP(VFS_MOUNTED)] = VFS_OP_DEFINED,
    5859                [IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_NULL,
    5960        }
     
    9899                callid = async_get_call(&call);
    99100                switch  (IPC_GET_METHOD(call)) {
     101                case VFS_MOUNTED:
     102                        fat_mounted(callid, &call);
     103                        break;
     104                case VFS_MOUNT:
     105                        fat_mount(callid, &call);
     106                        break;
    100107                case VFS_LOOKUP:
    101108                        fat_lookup(callid, &call);
     
    111118{
    112119        int vfs_phone;
     120        int rc;
    113121
    114122        printf("FAT: HelenOS FAT file system server.\n");
     123
     124        rc = fat_idx_init();
     125        if (rc != EOK)
     126                goto err;
    115127
    116128        vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0, 0);
     
    120132        }
    121133       
    122         int rc;
    123134        rc = fs_register(vfs_phone, &fat_reg, &fat_vfs_info, fat_connection);
    124135        if (rc != EOK) {
    125                 printf("Failed to register the FAT file system (%d)\n", rc);
    126                 return rc;
     136                fat_idx_fini();
     137                goto err;
    127138        }
    128139       
     
    133144        /* not reached */
    134145        return 0;
     146
     147err:
     148        printf("Failed to register the FAT file system (%d)\n", rc);
     149        return rc;
    135150}
    136151
Note: See TracChangeset for help on using the changeset viewer.