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

    /* short-circuit a 0-byte write */
    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 write file data */
    if (meta->storage == FILE_STORAGE_FIXED_CHUNK\
    		|| meta->storage == FILE_STORAGE_LOGIO) {
        /* file stored in fixed-size chunks */
        rc = unifycr_fid_store_fixed_write(fid, meta, pos, buf, count);
    } else {
        /* unknown storage type */
        rc = UNIFYCR_ERR_IO;
    }

    return rc;
}
/* write count bytes from buf into file starting at offset pos,
 * all bytes are assumed to be allocated to file, so file should
 * be extended before calling this routine */
write count bytes from buf into file starting at offset pos,
all bytes are assumed to be allocated to file, so file should
be extended before calling this routine
write count bytes from buf into file starting at offset pos all bytes are assumed to be allocated to file so file should be extended before calling this routine
int unifycr_fid_write(int fid, off_t pos, const 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\
    		|| meta->storage == FILE_STORAGE_LOGIO) {
        rc = unifycr_fid_store_fixed_write(fid, meta, pos, buf, count);
    } else {
        rc = UNIFYCR_ERR_IO;
    }
    return rc;
}
int unifycr_fid_write ( int fid , off_t pos , const 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 || meta -> storage == FILE_STORAGE_LOGIO ) { rc = unifycr_fid_store_fixed_write ( fid , meta , pos , buf , count ) ; } else { rc = UNIFYCR_ERR_IO ; } return rc ; }
write count bytes from buf into file starting at offset pos,
 all bytes are assumed to be allocated to file, so file should
 be extended before calling this routine
write count bytes from buf into file starting at offset pos all bytes are assumed to be allocated to file so file should be extended before calling this routine
/* short-circuit a 0-byte write */ /* get meta for this file id */ /* determine storage type to write file data */ /* file stored in fixed-size chunks */ /* unknown storage type */