src/server/safs/service.c

branch
aio
changeset 186
8041ac363f26
parent 184
a2a15ad6e4b9
child 189
a2438f6d1e73
equal deleted inserted replaced
185:b4d7ccf4e06d 186:8041ac363f26
343 if(!asr->read_complete) { 343 if(!asr->read_complete) {
344 // write completed => new asynchronous read 344 // write completed => new asynchronous read
345 asr->aio->offset += asr->aio->result; 345 asr->aio->offset += asr->aio->result;
346 size_t length = asr->end - asr->offset; 346 size_t length = asr->end - asr->offset;
347 asr->aio->nbytes = AIO_BUF_SIZE < length ? AIO_BUF_SIZE : length; 347 asr->aio->nbytes = AIO_BUF_SIZE < length ? AIO_BUF_SIZE : length;
348 asr->read_inprogress = TRUE;
348 if(system_aio_read(asr->aio)) { 349 if(system_aio_read(asr->aio)) {
349 asr->error = TRUE; 350 asr->error = TRUE;
350 return 1; 351 return 1;
351 } 352 }
352 } 353 }
480 aio->event = readev; 481 aio->event = readev;
481 482
482 asr->aio = aio; 483 asr->aio = aio;
483 asr->wpos = 0; 484 asr->wpos = 0;
484 485
486 asr->read_inprogress = TRUE;
485 if(system_aio_read(aio)) { 487 if(system_aio_read(aio)) {
486 send_range_cleanup(asr); 488 send_range_cleanup(asr);
487 return REQ_ABORTED; 489 return REQ_ABORTED;
488 } 490 }
489 asr->read_inprogress = TRUE; 491 asr->read_inprogress = TRUE;

mercurial