cache.c
//Should only be called if a lock on the block is held by the caller
//Should only return true if successful and if toPush->dirty has been set to false
Should only be called if a lock on the block is held by the caller
Should only return true if successful and if toPush->dirty has been set to false
Should only be called if a lock on the block is held by the caller Should only return true if successful and if toPush - > dirty has been set to false
bool pushBlockToServer(block_t* toPush) {
    fprintf(stderr, "Pushing block to server\n");
    server_t* server = get_server(toPush->host);
    write_block(server->hostname, server->port, toPush->id, toPush->data); 
    toPush->dirty = false;
    return true; 
}
bool pushBlockToServer ( block_t * toPush ) { fprintf ( stderr , " \n " ) ; server_t * server = get_server ( toPush -> host ) ; write_block ( server -> hostname , server -> port , toPush -> id , toPush -> data ) ; toPush -> dirty = false ; return true ; }
Should only be called if a lock on the block is held by the caller
Should only return true if successful and if toPush->dirty has been set to false
Should only be called if a lock on the block is held by the caller Should only return true if successful and if toPush - > dirty has been set to false
///Might want to catch error from this for retrys? i.e. don't mark clean if write-back fails //Check if block is the last in the file -> update stat //for debugging