Changeset d2c8533 in mainline for uspace/srv/volsrv/part.c


Ignore:
Timestamp:
2017-05-08T20:38:47Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f066a87
Parents:
582a0b8
Message:

File system probing groundwork. Only MFS can do it for now.

File:
1 edited

Legend:

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

    r582a0b8 rd2c8533  
    4242#include <stdlib.h>
    4343#include <str.h>
     44#include <vfs/vfs.h>
    4445
    4546#include "empty.h"
     
    132133        vol_part_t *part;
    133134        bool empty;
     135        vfs_fs_probe_info_t info;
    134136        int rc;
    135137
     
    154156        }
    155157
    156         log_msg(LOG_DEFAULT, LVL_DEBUG, "Probe partition %s", part->svc_name);
    157         rc = volsrv_part_is_empty(sid, &empty);
    158         if (rc != EOK) {
    159                 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed determining if "
    160                     "partition is empty.");
    161                 goto error;
    162         }
    163 
    164         part->pcnt = empty ? vpc_empty : vpc_unknown;
     158        log_msg(LOG_DEFAULT, LVL_NOTE, "Probe partition %s", part->svc_name);
     159        rc = vfs_fsprobe("mfs", sid, &info);
     160        if (rc == EOK) {
     161                part->pcnt = vpc_fs;
     162                part->fstype = fs_minix;
     163        } else {
     164                log_msg(LOG_DEFAULT, LVL_NOTE, "Partition does not contain "
     165                    "a recognized file system.");
     166
     167                rc = volsrv_part_is_empty(sid, &empty);
     168                if (rc != EOK) {
     169                        log_msg(LOG_DEFAULT, LVL_ERROR, "Failed determining if "
     170                            "partition is empty.");
     171                        goto error;
     172                }
     173
     174                part->pcnt = empty ? vpc_empty : vpc_unknown;
     175        }
     176
    165177        list_append(&part->lparts, &vol_parts);
    166178
Note: See TracChangeset for help on using the changeset viewer.