Changeset 395df52 in mainline for uspace/srv/volsrv/part.c


Ignore:
Timestamp:
2017-05-12T19:58:27Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e48947e
Parents:
de5b708
Message:

Probing for ExFAT, Ext4 and CDFS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/volsrv/part.c

    rde5b708 r395df52  
    5353static FIBRIL_MUTEX_INITIALIZE(vol_parts_lock);
    5454
     55struct fsname_type {
     56        const char *name;
     57        vol_fstype_t fstype;
     58};
     59
     60static struct fsname_type fstab[] = {
     61        { "ext4fs", fs_ext4 },
     62        { "cdfs", fs_cdfs },
     63        { "exfat", fs_exfat },
     64        { "fat", fs_fat },
     65        { "mfs", fs_minix },
     66        { NULL, 0 }
     67};
     68
    5569/** Check for new partitions */
    5670static int vol_part_check_new(void)
     
    134148        bool empty;
    135149        vfs_fs_probe_info_t info;
     150        struct fsname_type *fst;
    136151        int rc;
    137152
     
    157172
    158173        log_msg(LOG_DEFAULT, LVL_NOTE, "Probe partition %s", part->svc_name);
    159         rc = vfs_fsprobe("mfs", sid, &info);
    160         if (rc == EOK) {
     174
     175        fst = &fstab[0];
     176        while (fst->name != NULL) {
     177                rc = vfs_fsprobe(fst->name, sid, &info);
     178                if (rc == EOK)
     179                        break;
     180                ++fst;
     181        }
     182
     183        if (fst->name != NULL) {
     184                log_msg(LOG_DEFAULT, LVL_NOTE, "Found %s", fst->name);
    161185                part->pcnt = vpc_fs;
    162                 part->fstype = fs_minix;
     186                part->fstype = fst->fstype;
    163187        } else {
    164188                log_msg(LOG_DEFAULT, LVL_NOTE, "Partition does not contain "
Note: See TracChangeset for help on using the changeset viewer.