Changeset eb87adb in mainline


Ignore:
Timestamp:
2011-09-24T20:25:46Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d03da17
Parents:
4093b14 (diff), f1a9e87 (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

Files:
25 edited

Legend:

Unmodified
Added
Removed
  • contrib/arch/uspace/srv/vfs/vfs.adl

    r4093b14 reb87adb  
    44               
    55                /* Mount filesystem */
    6                 sysarg_t mount(in sysarg_t device, in sysarg_t flags, in_copy string point, in_copy string opts, in_copy string fs);
     6                sysarg_t mount(in sysarg_t device, in sysarg_t flags, in sysarg_t instance, in_copy string point, in_copy string opts, in_copy string fs);
    77               
    88                /* Open file */
     
    5656               
    5757                /* Mount filesystem */
    58                 sysarg_t mount(in sysarg_t device, in sysarg_t flags, in_copy string point, in_copy string opts, ...);
     58                sysarg_t mount(in sysarg_t device, in sysarg_t flags, in sysarg_t instance, in_copy string point, in_copy string opts, ...);
    5959               
    6060                /* Open file by node */
  • kernel/arch/ia64/include/asm.h

    r4093b14 reb87adb  
    4444#define IA64_IOSPACE_ADDRESS  0xE001000000000000ULL
    4545
     46#define IO_SPACE_BOUNDARY       ((void *) (64 * 1024))
     47
    4648NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t v)
    4749{
    48         uintptr_t prt = (uintptr_t) port;
    49        
    50         *((ioport8_t *) (IA64_IOSPACE_ADDRESS +
    51             ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     50        if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
     51                uintptr_t prt = (uintptr_t) port;
     52       
     53                *((ioport8_t *) (IA64_IOSPACE_ADDRESS +
     54                    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     55        } else {
     56                *port = v;
     57        }
    5258       
    5359        asm volatile (
     
    5965NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t v)
    6066{
    61         uintptr_t prt = (uintptr_t) port;
    62        
    63         *((ioport16_t *) (IA64_IOSPACE_ADDRESS +
    64             ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     67        if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
     68                uintptr_t prt = (uintptr_t) port;
     69       
     70                *((ioport16_t *) (IA64_IOSPACE_ADDRESS +
     71                    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     72        } else {
     73                *port = v;
     74        }
    6575       
    6676        asm volatile (
     
    7282NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t v)
    7383{
    74         uintptr_t prt = (uintptr_t) port;
    75        
    76         *((ioport32_t *) (IA64_IOSPACE_ADDRESS +
    77             ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     84        if (port < (ioport32_t *) IO_SPACE_BOUNDARY) {
     85                uintptr_t prt = (uintptr_t) port;
     86       
     87                *((ioport32_t *) (IA64_IOSPACE_ADDRESS +
     88                    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     89        } else {
     90                *port = v;
     91        }
    7892       
    7993        asm volatile (
     
    8599NO_TRACE static inline uint8_t pio_read_8(ioport8_t *port)
    86100{
    87         uintptr_t prt = (uintptr_t) port;
    88        
    89         asm volatile (
    90                 "mf\n"
    91                 ::: "memory"
    92         );
    93        
    94         return *((ioport8_t *) (IA64_IOSPACE_ADDRESS +
    95             ((prt & 0xfff) | ((prt >> 2) << 12))));
     101        uint8_t v;
     102
     103        asm volatile (
     104                "mf\n"
     105                ::: "memory"
     106        );
     107
     108        if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
     109                uintptr_t prt = (uintptr_t) port;
     110
     111                v = *((ioport8_t *) (IA64_IOSPACE_ADDRESS +
     112                    ((prt & 0xfff) | ((prt >> 2) << 12))));
     113        } else {
     114                v = *port;
     115        }
     116       
     117        return v;
    96118}
    97119
    98120NO_TRACE static inline uint16_t pio_read_16(ioport16_t *port)
    99121{
    100         uintptr_t prt = (uintptr_t) port;
    101        
    102         asm volatile (
    103                 "mf\n"
    104                 ::: "memory"
    105         );
    106        
    107         return *((ioport16_t *) (IA64_IOSPACE_ADDRESS +
    108             ((prt & 0xfff) | ((prt >> 2) << 12))));
     122        uint16_t v;
     123
     124        asm volatile (
     125                "mf\n"
     126                ::: "memory"
     127        );
     128
     129        if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
     130                uintptr_t prt = (uintptr_t) port;
     131
     132                v = *((ioport16_t *) (IA64_IOSPACE_ADDRESS +
     133                    ((prt & 0xfff) | ((prt >> 2) << 12))));
     134        } else {
     135                v = *port;
     136        }
     137       
     138        return v;
    109139}
    110140
    111141NO_TRACE static inline uint32_t pio_read_32(ioport32_t *port)
    112142{
    113         uintptr_t prt = (uintptr_t) port;
    114        
    115         asm volatile (
    116                 "mf\n"
    117                 ::: "memory"
    118         );
    119        
    120         return *((ioport32_t *) (IA64_IOSPACE_ADDRESS +
    121             ((prt & 0xfff) | ((prt >> 2) << 12))));
     143        uint32_t v;
     144       
     145        asm volatile (
     146                "mf\n"
     147                ::: "memory"
     148        );
     149       
     150        if (port < (ioport32_t *) IO_SPACE_BOUNDARY) {
     151                uintptr_t prt = (uintptr_t) port;
     152               
     153                v = *((ioport32_t *) (IA64_IOSPACE_ADDRESS +
     154                    ((prt & 0xfff) | ((prt >> 2) << 12))));
     155        } else {
     156                v = *port;
     157        }
     158
     159        return v;
    122160}
    123161
  • kernel/generic/src/adt/btree.c

    r4093b14 reb87adb  
    3838 *
    3939 * The B+tree has the following properties:
    40  * @li it is a ballanced 3-4-5 tree (i.e. BTREE_M = 5)
     40 * @li it is a balanced 3-4-5 tree (i.e. BTREE_M = 5)
    4141 * @li values (i.e. pointers to values) are stored only in leaves
    4242 * @li leaves are linked in a list
    4343 *
    44  * Be carefull when using these trees. They need to allocate
     44 * Be careful when using these trees. They need to allocate
    4545 * and deallocate memory for their index nodes and as such
    4646 * can sleep.
     
    146146 * also makes use of this feature.
    147147 *
    148  * @param node     B-tree node into wich the new key is to be inserted.
     148 * @param node     B-tree node into which the new key is to be inserted.
    149149 * @param key      The key to be inserted.
    150150 * @param value    Pointer to value to be inserted.
     
    270270 * This feature is used during insert by right rotation.
    271271 *
    272  * @param node     B-tree node into wich the new key is to be inserted.
     272 * @param node     B-tree node into which the new key is to be inserted.
    273273 * @param key      The key to be inserted.
    274274 * @param value    Pointer to value to be inserted.
     
    463463        if (rnode->keys < BTREE_MAX_KEYS) {
    464464                /*
    465                  * The rotaion can be done. The right sibling has free space.
     465                 * The rotation can be done. The right sibling has free space.
    466466                 */
    467467                node_insert_key_and_rsubtree(node, inskey, insvalue, rsubtree);
     
    484484 * the median will be copied there.
    485485 *
    486  * @param node     B-tree node wich is going to be split.
     486 * @param node     B-tree node which is going to be split.
    487487 * @param key      The key to be inserted.
    488488 * @param value    Pointer to the value to be inserted.
     
    562562        if (node->keys < BTREE_MAX_KEYS) {
    563563                /*
    564                  * Node conatins enough space, the key can be stored immediately.
     564                 * Node contains enough space, the key can be stored immediately.
    565565                 */
    566566                node_insert_key_and_rsubtree(node, key, value, rsubtree);
     
    806806               
    807807                /*
    808                  * The key can be immediatelly removed.
     808                 * The key can be immediately removed.
    809809                 *
    810810                 * Note that the right subtree is removed because when
  • kernel/generic/src/adt/list.c

    r4093b14 reb87adb  
    3333/**
    3434 * @file
    35  * @brief       Functions completing doubly linked circular list implementaion.
     35 * @brief       Functions completing doubly linked circular list implementation.
    3636 *
    3737 * This file contains some of the functions implementing doubly linked circular lists.
  • uspace/app/bdsh/cmds/modules/mount/mount.c

    r4093b14 reb87adb  
    4343static struct option const long_options[] = {
    4444        { "help", no_argument, 0, 'h' },
     45        { "instance", required_argument, 0, 'i' },
    4546        { 0, 0, 0, 0 }
    4647};
     
    6869        const char *dev = "";
    6970        int rc, c, opt_ind;
     71        unsigned int instance = 0;
     72        bool instance_set = false;
     73        char **t_argv;
    7074
    7175        argc = cli_count_args(argv);
    7276
    7377        for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
    74                 c = getopt_long(argc, argv, "h", long_options, &opt_ind);
     78                c = getopt_long(argc, argv, "i:h", long_options, &opt_ind);
    7579                switch (c) {
    7680                case 'h':
    7781                        help_cmd_mount(HELP_LONG);
    7882                        return CMD_SUCCESS;
     83                case 'i':
     84                        instance = (unsigned int) strtol(optarg, NULL, 10);
     85                        instance_set = true;
     86                        break;
    7987                }
    8088        }
     89
     90        if (instance_set) {
     91                argc -= 2;
     92                t_argv = &argv[2];
     93        } else
     94                t_argv = &argv[0];
    8195
    8296        if ((argc < 3) || (argc > 5)) {
     
    86100        }
    87101        if (argc > 3)
    88                 dev = argv[3];
     102                dev = t_argv[3];
    89103        if (argc == 5)
    90                 mopts = argv[4];
     104                mopts = t_argv[4];
    91105
    92         rc = mount(argv[1], argv[2], dev, mopts, 0);
     106        rc = mount(t_argv[1], t_argv[2], dev, mopts, 0, instance);
    93107        if (rc != EOK) {
    94108                printf("Unable to mount %s filesystem to %s on %s (rc=%d)\n",
    95                     argv[1], argv[2], argv[3], rc);
     109                    t_argv[1], t_argv[2], t_argv[3], rc);
    96110                return CMD_FAILURE;
    97111        }
  • uspace/app/init/init.c

    r4093b14 reb87adb  
    121121       
    122122        int rc = mount(fstype, ROOT_MOUNT_POINT, ROOT_DEVICE, opts,
    123             IPC_FLAG_BLOCKING);
     123            IPC_FLAG_BLOCKING, 0);
    124124        return mount_report("Root filesystem", ROOT_MOUNT_POINT, fstype,
    125125            ROOT_DEVICE, rc);
     
    138138{
    139139        int rc = mount(LOCFS_FS_TYPE, LOCFS_MOUNT_POINT, "", "",
    140             IPC_FLAG_BLOCKING);
     140            IPC_FLAG_BLOCKING, 0);
    141141        return mount_report("Location service filesystem", LOCFS_MOUNT_POINT,
    142142            LOCFS_FS_TYPE, NULL, rc);
     
    261261static bool mount_tmpfs(void)
    262262{
    263         int rc = mount(TMPFS_FS_TYPE, TMPFS_MOUNT_POINT, "", "", 0);
     263        int rc = mount(TMPFS_FS_TYPE, TMPFS_MOUNT_POINT, "", "", 0, 0);
    264264        return mount_report("Temporary filesystem", TMPFS_MOUNT_POINT,
    265265            TMPFS_FS_TYPE, NULL, rc);
     
    268268static bool mount_data(void)
    269269{
    270         int rc = mount(DATA_FS_TYPE, DATA_MOUNT_POINT, DATA_DEVICE, "wtcache", 0);
     270        int rc = mount(DATA_FS_TYPE, DATA_MOUNT_POINT, DATA_DEVICE, "wtcache", 0, 0);
    271271        return mount_report("Data filesystem", DATA_MOUNT_POINT, DATA_FS_TYPE,
    272272            DATA_DEVICE, rc);
  • uspace/drv/bus/usb/usbhub/usbhub.c

    r4093b14 reb87adb  
    130130
    131131        opResult = ddf_fun_bind(hub_fun);
    132         assert(opResult == EOK);
    133         opResult = ddf_fun_add_to_category(hub_fun, "hub");
    134132        assert(opResult == EOK);
    135133
  • uspace/lib/c/arch/ia64/include/ddi.h

    r4093b14 reb87adb  
    5252static inline void pio_write_8(ioport8_t *port, uint8_t v)
    5353{
    54         uintptr_t prt = (uintptr_t) port;
     54        if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
     55                uintptr_t prt = (uintptr_t) port;
    5556
    56         *((ioport8_t *)(IA64_IOSPACE_ADDRESS +
    57             ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     57                *((ioport8_t *)(IA64_IOSPACE_ADDRESS +
     58                    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     59        } else {
     60                *port = v;
     61        }
    5862
    5963        asm volatile ("mf\n" ::: "memory");
     
    6266static inline void pio_write_16(ioport16_t *port, uint16_t v)
    6367{
    64         uintptr_t prt = (uintptr_t) port;
     68        if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
     69                uintptr_t prt = (uintptr_t) port;
    6570
    66         *((ioport16_t *)(IA64_IOSPACE_ADDRESS +
    67             ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     71                *((ioport16_t *)(IA64_IOSPACE_ADDRESS +
     72                    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     73        } else {
     74                *port = v;
     75        }
    6876
    6977        asm volatile ("mf\n" ::: "memory");
     
    7280static inline void pio_write_32(ioport32_t *port, uint32_t v)
    7381{
    74         uintptr_t prt = (uintptr_t) port;
     82        if (port < (ioport32_t *) IO_SPACE_BOUNDARY) {
     83                uintptr_t prt = (uintptr_t) port;
    7584
    76         *((ioport32_t *)(IA64_IOSPACE_ADDRESS +
    77             ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     85                *((ioport32_t *)(IA64_IOSPACE_ADDRESS +
     86                    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
     87        } else {
     88                *port = v;
     89        }
    7890
    7991        asm volatile ("mf\n" ::: "memory");
     
    8294static inline uint8_t pio_read_8(ioport8_t *port)
    8395{
    84         uintptr_t prt = (uintptr_t) port;
     96        uint8_t v;
    8597
    8698        asm volatile ("mf\n" ::: "memory");
    8799
    88         return *((ioport8_t *)(IA64_IOSPACE_ADDRESS +
    89             ((prt & 0xfff) | ((prt >> 2) << 12))));
     100        if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
     101                uintptr_t prt = (uintptr_t) port;
     102
     103                v = *((ioport8_t *)(IA64_IOSPACE_ADDRESS +
     104                    ((prt & 0xfff) | ((prt >> 2) << 12))));
     105        } else {
     106                v = *port;
     107        }
     108
     109        return v;
    90110}
    91111
    92112static inline uint16_t pio_read_16(ioport16_t *port)
    93113{
    94         uintptr_t prt = (uintptr_t) port;
     114        uint16_t v;
    95115
    96116        asm volatile ("mf\n" ::: "memory");
    97117
    98         return *((ioport16_t *)(IA64_IOSPACE_ADDRESS +
    99             ((prt & 0xfff) | ((prt >> 2) << 12))));
     118        if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
     119                uintptr_t prt = (uintptr_t) port;
     120
     121                v = *((ioport16_t *)(IA64_IOSPACE_ADDRESS +
     122                    ((prt & 0xfff) | ((prt >> 2) << 12))));
     123        } else {
     124                v = *port;
     125        }
     126
     127        return v;
    100128}
    101129
    102130static inline uint32_t pio_read_32(ioport32_t *port)
    103131{
    104         uintptr_t prt = (uintptr_t) port;
     132        uint32_t v;
    105133
    106134        asm volatile ("mf\n" ::: "memory");
    107135
    108         return *((ioport32_t *)(IA64_IOSPACE_ADDRESS +
    109             ((prt & 0xfff) | ((prt >> 2) << 12))));
     136        if (port < (ioport32_t *) port) {
     137                uintptr_t prt = (uintptr_t) port;
     138
     139                v = *((ioport32_t *)(IA64_IOSPACE_ADDRESS +
     140                    ((prt & 0xfff) | ((prt >> 2) << 12))));
     141        } else {
     142                v = *port;
     143        }
     144
     145        return v;
    110146}
    111147
  • uspace/lib/c/generic/adt/hash_table.c

    r4093b14 reb87adb  
    190190}
    191191
    192 /** Apply fucntion to all items in hash table.
     192/** Apply function to all items in hash table.
    193193 *
    194194 * @param h   Hash table.
  • uspace/lib/c/generic/adt/list.c

    r4093b14 reb87adb  
    3333/**
    3434 * @file
    35  * @brief       Functions completing doubly linked circular list implementaion.
     35 * @brief       Functions completing doubly linked circular list implementation.
    3636 *
    3737 * This file contains some of the functions implementing doubly linked circular lists.
  • uspace/lib/c/generic/malloc.c

    r4093b14 reb87adb  
    873873void free(const void *addr)
    874874{
     875        if (addr == NULL)
     876                return;
     877
    875878        futex_down(&malloc_futex);
    876879       
  • uspace/lib/c/generic/vfs/vfs.c

    r4093b14 reb87adb  
    143143
    144144int mount(const char *fs_name, const char *mp, const char *fqsn,
    145     const char *opts, unsigned int flags)
     145    const char *opts, unsigned int flags, unsigned int instance)
    146146{
    147147        int null_id = -1;
     
    181181
    182182        sysarg_t rc_orig;
    183         aid_t req = async_send_2(exch, VFS_IN_MOUNT, service_id, flags, NULL);
     183        aid_t req = async_send_3(exch, VFS_IN_MOUNT, service_id, flags,
     184            instance, NULL);
    184185        sysarg_t rc = async_data_write_start(exch, (void *) mpa, mpa_size);
    185186        if (rc != EOK) {
  • uspace/lib/c/include/ipc/vfs.h

    r4093b14 reb87adb  
    5656        /** Unique identifier of the fs. */
    5757        char name[FS_NAME_MAXLEN + 1];
     58        unsigned int instance;
    5859        bool concurrent_read_write;
    5960        bool write_retains_size;
  • uspace/lib/c/include/vfs/vfs.h

    r4093b14 reb87adb  
    4949
    5050extern int mount(const char *, const char *, const char *, const char *,
    51     unsigned int);
     51    unsigned int, unsigned int);
    5252extern int unmount(const char *);
    5353
  • uspace/srv/devman/main.c

    r4093b14 reb87adb  
    490490        if (rc == EOK) {
    491491                loc_service_add_to_cat(fun->service_id, cat_id);
     492                log_msg(LVL_NOTE, "Function `%s' added to category `%s'.",
     493                    fun->pathname, cat_name);
    492494        } else {
    493495                log_msg(LVL_ERROR, "Failed adding function `%s' to category "
     
    495497        }
    496498       
    497         log_msg(LVL_NOTE, "Function `%s' added to category `%s'.",
    498             fun->pathname, cat_name);
    499 
    500499        fibril_rwlock_read_unlock(&device_tree.rwlock);
    501500        fun_del_ref(fun);
    502 
    503         async_answer_0(callid, EOK);
     501       
     502        async_answer_0(callid, rc);
    504503}
    505504
  • uspace/srv/fs/cdfs/cdfs.c

    r4093b14 reb87adb  
    5252        .concurrent_read_write = false,
    5353        .write_retains_size = false,
     54        .instance = 0,
    5455};
    5556
     
    5859        printf("%s: HelenOS cdfs file system server\n", NAME);
    5960       
     61        if (argc == 3) {
     62                if (!str_cmp(argv[1], "--instance"))
     63                        cdfs_vfs_info.instance = strtol(argv[2], NULL, 10);
     64                else {
     65                        printf(NAME " Unrecognized parameters");
     66                        return -1;
     67                }
     68        }
     69
    6070        if (!cdfs_init()) {
    6171                printf("%s: failed to initialize cdfs\n", NAME);
  • uspace/srv/fs/exfat/exfat.c

    r4093b14 reb87adb  
    5454        .name = NAME,
    5555        .concurrent_read_write = false,
    56         .write_retains_size = false,   
     56        .write_retains_size = false,
     57        .instance = 0,
    5758};
    5859
     
    6061{
    6162        printf(NAME ": HelenOS exFAT file system server\n");
     63
     64        if (argc == 3) {
     65                if (!str_cmp(argv[1], "--instance"))
     66                        exfat_vfs_info.instance = strtol(argv[2], NULL, 10);
     67                else {
     68                        printf(NAME " Unrecognized parameters");
     69                        return -1;
     70                }
     71        }
    6272
    6373        int rc = exfat_idx_init();
  • uspace/srv/fs/ext2fs/ext2fs.c

    r4093b14 reb87adb  
    5252vfs_info_t ext2fs_vfs_info = {
    5353        .name = NAME,
     54        .instance = 0,
    5455};
    5556
     
    5758{
    5859        printf(NAME ": HelenOS EXT2 file system server\n");
     60
     61        if (argc == 3) {
     62                if (!str_cmp(argv[1], "--instance"))
     63                        ext2fs_vfs_info.instance = strtol(argv[2], NULL, 10);
     64                else {
     65                        printf(NAME " Unrecognized parameters");
     66                        return -1;
     67                }
     68        }
    5969       
    6070        async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
  • uspace/srv/fs/fat/fat.c

    r4093b14 reb87adb  
    5454        .name = NAME,
    5555        .concurrent_read_write = false,
    56         .write_retains_size = false,   
     56        .write_retains_size = false,
     57        .instance = 0,
    5758};
    5859
     
    6162        printf(NAME ": HelenOS FAT file system server\n");
    6263       
     64        if (argc == 3) {
     65                if (!str_cmp(argv[1], "--instance"))
     66                        fat_vfs_info.instance = strtol(argv[2], NULL, 10);
     67                else {
     68                        printf(NAME " Unrecognized parameters");
     69                        return -1;
     70                }
     71        }
     72
    6373        int rc = fat_idx_init();
    6474        if (rc != EOK)
  • uspace/srv/fs/locfs/locfs.c

    r4093b14 reb87adb  
    5555        .concurrent_read_write = false,
    5656        .write_retains_size = false,
     57        .instance = 0,
    5758};
    5859
     
    6162        printf("%s: HelenOS Device Filesystem\n", NAME);
    6263       
     64        if (argc == 3) {
     65                if (!str_cmp(argv[1], "--instance"))
     66                        locfs_vfs_info.instance = strtol(argv[2], NULL, 10);
     67                else {
     68                        printf(NAME " Unrecognized parameters");
     69                        return -1;
     70                }
     71        }
     72
     73
    6374        if (!locfs_init()) {
    6475                printf("%s: failed to initialize locfs\n", NAME);
  • uspace/srv/fs/mfs/mfs.c

    r4093b14 reb87adb  
    3939
    4040#include <ipc/services.h>
     41#include <stdlib.h>
     42#include <str.h>
    4143#include <ns.h>
    4244#include <async.h>
     
    5254        .concurrent_read_write = false,
    5355        .write_retains_size = false,
     56        .instance = 0,
    5457};
    5558
     
    5962
    6063        printf(NAME ": HelenOS Minix file system server\n");
     64
     65        if (argc == 3) {
     66                if (!str_cmp(argv[1], "--instance"))
     67                        mfs_vfs_info.instance = strtol(argv[2], NULL, 10);
     68                else {
     69                        printf(NAME " Unrecognized parameters");
     70                        rc = -1;
     71                        goto err;
     72                }
     73        }
    6174
    6275        async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
  • uspace/srv/fs/tmpfs/tmpfs.c

    r4093b14 reb87adb  
    5959        .concurrent_read_write = false,
    6060        .write_retains_size = false,
     61        .instance = 0,
    6162};
    6263
     
    6465{
    6566        printf(NAME ": HelenOS TMPFS file system server\n");
     67
     68        if (argc == 3) {
     69                if (!str_cmp(argv[1], "--instance"))
     70                        tmpfs_vfs_info.instance = strtol(argv[2], NULL, 10);
     71                else {
     72                        printf(NAME " Unrecognized parameters");
     73                        return -1;
     74                }
     75        }
    6676       
    6777        if (!tmpfs_init()) {
  • uspace/srv/vfs/vfs.h

    r4093b14 reb87adb  
    171171extern void vfs_exchange_release(async_exch_t *);
    172172
    173 extern fs_handle_t fs_name_to_handle(char *, bool);
     173extern fs_handle_t fs_name_to_handle(unsigned int instance, char *, bool);
    174174extern vfs_info_t *fs_handle_to_info(fs_handle_t);
    175175
  • uspace/srv/vfs/vfs_ops.c

    r4093b14 reb87adb  
    146146
    147147                        rindex = (fs_index_t) IPC_GET_ARG1(answer);
    148                         rsize = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG2(answer), IPC_GET_ARG3(answer));
     148                        rsize = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG2(answer),
     149                            IPC_GET_ARG3(answer));
    149150                        rlnkcnt = (unsigned) IPC_GET_ARG4(answer);
    150151                       
     
    276277       
    277278        /*
    278          * For now, don't make use of ARG3, but it can be used to
    279          * carry mount options in the future.
    280          */
    281        
     279         * Instance number is passed as ARG3.
     280         */
     281        unsigned int instance = IPC_GET_ARG3(*request);
     282
    282283        /* We want the client to send us the mount point. */
    283284        char *mp;
     
    335336        fs_handle_t fs_handle;
    336337recheck:
    337         fs_handle = fs_name_to_handle(fs_name, false);
     338        fs_handle = fs_name_to_handle(instance, fs_name, false);
    338339        if (!fs_handle) {
    339340                if (flags & IPC_FLAG_BLOCKING) {
  • uspace/srv/vfs/vfs_register.c

    r4093b14 reb87adb  
    154154         * Check for duplicit registrations.
    155155         */
    156         if (fs_name_to_handle(fs_info->vfs_info.name, false)) {
     156        if (fs_name_to_handle(fs_info->vfs_info.instance,
     157            fs_info->vfs_info.name, false)) {
    157158                /*
    158159                 * We already register a fs like this.
     
    297298 *
    298299 */
    299 fs_handle_t fs_name_to_handle(char *name, bool lock)
     300fs_handle_t fs_name_to_handle(unsigned int instance, char *name, bool lock)
    300301{
    301302        int handle = 0;
     
    306307        list_foreach(fs_list, cur) {
    307308                fs_info_t *fs = list_get_instance(cur, fs_info_t, fs_link);
    308                 if (str_cmp(fs->vfs_info.name, name) == 0) {
     309                if (str_cmp(fs->vfs_info.name, name) == 0 &&
     310                    instance == fs->vfs_info.instance) {
    309311                        handle = fs->fs_handle;
    310312                        break;
Note: See TracChangeset for help on using the changeset viewer.