client/src/unifycr.c
int unifycr_fid_extend(int fid, off_t length)
{
    int rc;

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

    /* determine file storage type */
    if (meta->storage == FILE_STORAGE_FIXED_CHUNK | \
				meta->storage == FILE_STORAGE_LOGIO) {
        /* file stored in fixed-size chunks */
        rc = unifycr_fid_store_fixed_extend(fid, meta, length);
    } else {
        /* unknown storage type */
        rc = UNIFYCR_ERR_IO;
    }

    /* TODO: move this statement elsewhere */
    /* increase file size up to length */
	if (meta->storage == FILE_STORAGE_FIXED_CHUNK)
	   if (length > meta->size) {
		  meta->size = length;
	   }

    return rc;
}
/* increase size of file if length is greater than current size,
 * and allocate additional chunks as needed to reserve space for
 * length bytes */
increase size of file if length is greater than current size,
and allocate additional chunks as needed to reserve space for
length bytes
increase size of file if length is greater than current size and allocate additional chunks as needed to reserve space for length bytes
int unifycr_fid_extend(int fid, off_t length)
{
    int rc;
    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_extend(fid, meta, length);
    } else {
        rc = UNIFYCR_ERR_IO;
    }
	if (meta->storage == FILE_STORAGE_FIXED_CHUNK)
	   if (length > meta->size) {
		  meta->size = length;
	   }
    return rc;
}
int unifycr_fid_extend ( int fid , off_t length ) { int rc ; 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_extend ( fid , meta , length ) ; } else { rc = UNIFYCR_ERR_IO ; } if ( meta -> storage == FILE_STORAGE_FIXED_CHUNK ) if ( length > meta -> size ) { meta -> size = length ; } return rc ; }
increase size of file if length is greater than current size,
 and allocate additional chunks as needed to reserve space for
 length bytes
increase size of file if length is greater than current size and allocate additional chunks as needed to reserve space for length bytes
/* get meta data for this file */ /* determine file storage type */ /* file stored in fixed-size chunks */ /* unknown storage type */ /* TODO: move this statement elsewhere */ /* increase file size up to length */