Changes in / [6fe0bf8d:ac2c3f8f] in mainline


Ignore:
Files:
16 edited

Legend:

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

    r6fe0bf8d rac2c3f8f  
    44               
    55                /* Mount filesystem */
    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);
     6                sysarg_t mount(in sysarg_t device, in sysarg_t flags, 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 sysarg_t instance, in_copy string point, in_copy string opts, ...);
     58                sysarg_t mount(in sysarg_t device, in sysarg_t flags, in_copy string point, in_copy string opts, ...);
    5959               
    6060                /* Open file by node */
  • uspace/app/bdsh/cmds/modules/mount/mount.c

    r6fe0bf8d rac2c3f8f  
    4343static struct option const long_options[] = {
    4444        { "help", no_argument, 0, 'h' },
    45         { "instance", required_argument, 0, 'i' },
    4645        { 0, 0, 0, 0 }
    4746};
     
    6968        const char *dev = "";
    7069        int rc, c, opt_ind;
    71         unsigned int instance = 0;
    72         bool instance_set = false;
    73         char **t_argv;
    7470
    7571        argc = cli_count_args(argv);
    7672
    7773        for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
    78                 c = getopt_long(argc, argv, "i:h", long_options, &opt_ind);
     74                c = getopt_long(argc, argv, "h", long_options, &opt_ind);
    7975                switch (c) {
    8076                case 'h':
    8177                        help_cmd_mount(HELP_LONG);
    8278                        return CMD_SUCCESS;
    83                 case 'i':
    84                         instance = (unsigned int) strtol(optarg, NULL, 10);
    85                         instance_set = true;
    86                         break;
    8779                }
    8880        }
    89 
    90         if (instance_set) {
    91                 argc -= 2;
    92                 t_argv = &argv[2];
    93         } else
    94                 t_argv = &argv[0];
    9581
    9682        if ((argc < 3) || (argc > 5)) {
     
    10086        }
    10187        if (argc > 3)
    102                 dev = t_argv[3];
     88                dev = argv[3];
    10389        if (argc == 5)
    104                 mopts = t_argv[4];
     90                mopts = argv[4];
    10591
    106         rc = mount(t_argv[1], t_argv[2], dev, mopts, 0, instance);
     92        rc = mount(argv[1], argv[2], dev, mopts, 0);
    10793        if (rc != EOK) {
    10894                printf("Unable to mount %s filesystem to %s on %s (rc=%d)\n",
    109                     t_argv[1], t_argv[2], t_argv[3], rc);
     95                    argv[1], argv[2], argv[3], rc);
    11096                return CMD_FAILURE;
    11197        }
  • uspace/app/init/init.c

    r6fe0bf8d rac2c3f8f  
    121121       
    122122        int rc = mount(fstype, ROOT_MOUNT_POINT, ROOT_DEVICE, opts,
    123             IPC_FLAG_BLOCKING, 0);
     123            IPC_FLAG_BLOCKING);
    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, 0);
     140            IPC_FLAG_BLOCKING);
    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, 0);
     263        int rc = mount(TMPFS_FS_TYPE, TMPFS_MOUNT_POINT, "", "", 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, 0);
     270        int rc = mount(DATA_FS_TYPE, DATA_MOUNT_POINT, DATA_DEVICE, "wtcache", 0);
    271271        return mount_report("Data filesystem", DATA_MOUNT_POINT, DATA_FS_TYPE,
    272272            DATA_DEVICE, rc);
  • uspace/lib/c/generic/vfs/vfs.c

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

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

    r6fe0bf8d rac2c3f8f  
    4949
    5050extern int mount(const char *, const char *, const char *, const char *,
    51     unsigned int, unsigned int);
     51    unsigned int);
    5252extern int unmount(const char *);
    5353
  • uspace/srv/fs/cdfs/cdfs.c

    r6fe0bf8d rac2c3f8f  
    5252        .concurrent_read_write = false,
    5353        .write_retains_size = false,
    54         .instance = 0,
    5554};
    5655
     
    5958        printf("%s: HelenOS cdfs file system server\n", NAME);
    6059       
    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 
    7060        if (!cdfs_init()) {
    7161                printf("%s: failed to initialize cdfs\n", NAME);
  • uspace/srv/fs/exfat/exfat.c

    r6fe0bf8d rac2c3f8f  
    5454        .name = NAME,
    5555        .concurrent_read_write = false,
    56         .write_retains_size = false,
    57         .instance = 0,
     56        .write_retains_size = false,   
    5857};
    5958
     
    6160{
    6261        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         }
    7262
    7363        int rc = exfat_idx_init();
  • uspace/srv/fs/ext2fs/ext2fs.c

    r6fe0bf8d rac2c3f8f  
    5252vfs_info_t ext2fs_vfs_info = {
    5353        .name = NAME,
    54         .instance = 0,
    5554};
    5655
     
    5857{
    5958        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         }
    6959       
    7060        async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
  • uspace/srv/fs/fat/fat.c

    r6fe0bf8d rac2c3f8f  
    5454        .name = NAME,
    5555        .concurrent_read_write = false,
    56         .write_retains_size = false,
    57         .instance = 0,
     56        .write_retains_size = false,   
    5857};
    5958
     
    6261        printf(NAME ": HelenOS FAT file system server\n");
    6362       
    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 
    7363        int rc = fat_idx_init();
    7464        if (rc != EOK)
  • uspace/srv/fs/locfs/locfs.c

    r6fe0bf8d rac2c3f8f  
    5555        .concurrent_read_write = false,
    5656        .write_retains_size = false,
    57         .instance = 0,
    5857};
    5958
     
    6261        printf("%s: HelenOS Device Filesystem\n", NAME);
    6362       
    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 
    7463        if (!locfs_init()) {
    7564                printf("%s: failed to initialize locfs\n", NAME);
  • uspace/srv/fs/mfs/mfs.c

    r6fe0bf8d rac2c3f8f  
    3939
    4040#include <ipc/services.h>
    41 #include <stdlib.h>
    42 #include <str.h>
    4341#include <ns.h>
    4442#include <async.h>
     
    5452        .concurrent_read_write = false,
    5553        .write_retains_size = false,
    56         .instance = 0,
    5754};
    5855
     
    6259
    6360        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         }
    7461
    7562        async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
  • uspace/srv/fs/tmpfs/tmpfs.c

    r6fe0bf8d rac2c3f8f  
    5959        .concurrent_read_write = false,
    6060        .write_retains_size = false,
    61         .instance = 0,
    6261};
    6362
     
    6564{
    6665        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         }
    7666       
    7767        if (!tmpfs_init()) {
  • uspace/srv/vfs/vfs.h

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

    r6fe0bf8d rac2c3f8f  
    146146
    147147                        rindex = (fs_index_t) IPC_GET_ARG1(answer);
    148                         rsize = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG2(answer),
    149                             IPC_GET_ARG3(answer));
     148                        rsize = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG2(answer), IPC_GET_ARG3(answer));
    150149                        rlnkcnt = (unsigned) IPC_GET_ARG4(answer);
    151150                       
     
    277276       
    278277        /*
    279          * Instance number is passed as ARG3.
    280          */
    281         unsigned int instance = IPC_GET_ARG3(*request);
    282 
     278         * For now, don't make use of ARG3, but it can be used to
     279         * carry mount options in the future.
     280         */
     281       
    283282        /* We want the client to send us the mount point. */
    284283        char *mp;
     
    336335        fs_handle_t fs_handle;
    337336recheck:
    338         fs_handle = fs_name_to_handle(instance, fs_name, false);
     337        fs_handle = fs_name_to_handle(fs_name, false);
    339338        if (!fs_handle) {
    340339                if (flags & IPC_FLAG_BLOCKING) {
  • uspace/srv/vfs/vfs_register.c

    r6fe0bf8d rac2c3f8f  
    154154         * Check for duplicit registrations.
    155155         */
    156         if (fs_name_to_handle(fs_info->vfs_info.instance,
    157             fs_info->vfs_info.name, false)) {
     156        if (fs_name_to_handle(fs_info->vfs_info.name, false)) {
    158157                /*
    159158                 * We already register a fs like this.
     
    298297 *
    299298 */
    300 fs_handle_t fs_name_to_handle(unsigned int instance, char *name, bool lock)
     299fs_handle_t fs_name_to_handle(char *name, bool lock)
    301300{
    302301        int handle = 0;
     
    307306        list_foreach(fs_list, cur) {
    308307                fs_info_t *fs = list_get_instance(cur, fs_info_t, fs_link);
    309                 if (str_cmp(fs->vfs_info.name, name) == 0 &&
    310                     instance == fs->vfs_info.instance) {
     308                if (str_cmp(fs->vfs_info.name, name) == 0) {
    311309                        handle = fs->fs_handle;
    312310                        break;
Note: See TracChangeset for help on using the changeset viewer.