client/src/unifycr.c
int unifycr_fid_read(int fid, off_t pos, void* buf, size_t count)
{
    int rc;

    /* short-circuit a 0-byte read */
    if (count == 0) {
        return UNIFYCR_SUCCESS;
    }

    /* get meta for this file id */
    unifycr_filemeta_t* meta = unifycr_get_meta_from_fid(fid);

    /* determine storage type to read file data */
    if (meta->storage == FILE_STORAGE_FIXED_CHUNK) {
        /* file stored in fixed-size chunks */
        rc = unifycr_fid_store_fixed_read(fid, meta, pos, buf, count);
    } else {
        /* unknown storage type */
        rc = UNIFYCR_ERR_IO;
    }

    return rc;
}
/* read count bytes from file starting from pos and store into buf,
 * all bytes are assumed to exist, so checks on file size should be
 * done before calling this routine */
read count bytes from file starting from pos and store into buf,
all bytes are assumed to exist, so checks on file size should be
done before calling this routine
read count bytes from file starting from pos and store into buf all bytes are assumed to exist so checks on file size should be done before calling this routine
int unifycr_fid_read(int fid, off_t pos, void* buf, size_t count)
{
    int rc;
    if (count == 0) {
        return UNIFYCR_SUCCESS;
    }
    unifycr_filemeta_t* meta = unifycr_get_meta_from_fid(fid);
    if (meta->storage == FILE_STORAGE_FIXED_CHUNK) {
        rc = unifycr_fid_store_fixed_read(fid, meta, pos, buf, count);
    } else {
        rc = UNIFYCR_ERR_IO;
    }
    return rc;
}
int unifycr_fid_read ( int fid , off_t pos , void * buf , size_t count ) { int rc ; if ( count == 0 ) { return UNIFYCR_SUCCESS ; } unifycr_filemeta_t * meta = unifycr_get_meta_from_fid ( fid ) ; if ( meta -> storage == FILE_STORAGE_FIXED_CHUNK ) { rc = unifycr_fid_store_fixed_read ( fid , meta , pos , buf , count ) ; } else { rc = UNIFYCR_ERR_IO ; } return rc ; }
read count bytes from file starting from pos and store into buf,
 all bytes are assumed to exist, so checks on file size should be
 done before calling this routine
read count bytes from file starting from pos and store into buf all bytes are assumed to exist so checks on file size should be done before calling this routine
/* short-circuit a 0-byte read */ /* get meta for this file id */ /* determine storage type to read file data */ /* file stored in fixed-size chunks */ /* unknown storage type */