Changeset 395df52 in mainline for uspace/srv/fs/fat/fat_ops.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/fs/fat/fat_ops.c

    rde5b708 r395df52  
    915915static int fat_fsprobe(service_id_t service_id, vfs_fs_probe_info_t *info)
    916916{
    917         return ENOTSUP;
     917        fat_bs_t *bs;
     918        int rc;
     919
     920        /* initialize libblock */
     921        rc = block_init(service_id, BS_SIZE);
     922        if (rc != EOK)
     923                return rc;
     924
     925        /* prepare the boot block */
     926        rc = block_bb_read(service_id, BS_BLOCK);
     927        if (rc != EOK) {
     928                block_fini(service_id);
     929                return rc;
     930        }
     931
     932        /* get the buffer with the boot sector */
     933        bs = block_bb_get(service_id);
     934
     935        if (BPS(bs) != BS_SIZE) {
     936                block_fini(service_id);
     937                return ENOTSUP;
     938        }
     939
     940        /* Initialize the block cache */
     941        rc = block_cache_init(service_id, BPS(bs), 0 /* XXX */, CACHE_MODE_WB);
     942        if (rc != EOK) {
     943                block_fini(service_id);
     944                return rc;
     945        }
     946
     947        /* Do some simple sanity checks on the file system. */
     948        rc = fat_sanity_check(bs, service_id);
     949
     950        (void) block_cache_fini(service_id);
     951        block_fini(service_id);
     952
     953        return rc;
    918954}
    919955
Note: See TracChangeset for help on using the changeset viewer.