Revision fda3449a xseg/peers/user/cached.c
b/xseg/peers/user/cached.c | ||
---|---|---|
488 | 488 |
if (bucket_readable(ce->status[i])) |
489 | 489 |
continue; |
490 | 490 |
if (ce->status[i] != LOADING){ |
491 |
XSEGLOG2(&lc, I, "Found invalid bucket %lu\n", i); |
|
491 | 492 |
start_bucket = i; |
492 | 493 |
end_bucket = __get_next_invalid(ce, start_bucket, limit); |
493 | 494 |
i = end_bucket; |
... | ... | |
502 | 503 |
} |
503 | 504 |
|
504 | 505 |
if (pending_buckets) { |
506 |
XSEGLOG2(&lc, I, "Pending buckets exist\n", i); |
|
505 | 507 |
/* Do not put cache entry yet */ |
506 | 508 |
cio->work.job_fn = handle_read; |
507 | 509 |
cio->work.job = pr; |
... | ... | |
630 | 632 |
* In this context we hold a reference to the cache entry and |
631 | 633 |
* the assocciated lock |
632 | 634 |
*/ |
635 |
XSEGLOG2(&lc, I, "Started\n"); |
|
633 | 636 |
|
634 | 637 |
struct req_completion *rc = (struct req_completion *)arg; |
635 | 638 |
struct peer_req *pr = rc->pr; |
... | ... | |
658 | 661 |
for (i = start; i <= end; i++) { |
659 | 662 |
if (ce->status[i] == LOADING){ |
660 | 663 |
if (success){ |
664 |
XSEGLOG2(&lc, I, |
|
665 |
"Bucket %lu loading and reception successful\n", i); |
|
661 | 666 |
memcpy(ce->data+(i*cached->bucket_size), data, |
662 | 667 |
cached->bucket_size); |
663 | 668 |
ce->status[i] = VALID; |
664 | 669 |
} |
665 | 670 |
else { |
671 |
XSEGLOG2(&lc, I, |
|
672 |
"Bucket %lu loading but reception unsuccessful\n", i); |
|
666 | 673 |
//reset status |
667 | 674 |
XSEGLOG2(&lc, E, "Before ce %p, i %lu, ce->status[i] %u", ce, i, ce->status[i]); |
668 | 675 |
ce->status[i] = INVALID; |
... | ... | |
672 | 679 |
} |
673 | 680 |
} |
674 | 681 |
free(rc); |
682 |
XSEGLOG2(&lc, I, "Finished\n"); |
|
675 | 683 |
} |
676 | 684 |
|
677 | 685 |
void complete_write(void *arg) |
... | ... | |
694 | 702 |
static int handle_receive_read(struct peerd *peer, struct peer_req *pr, |
695 | 703 |
struct xseg_request *req) |
696 | 704 |
{ |
705 |
XSEGLOG2(&lc, I, "Started\n"); |
|
697 | 706 |
/* |
698 | 707 |
* Should be rentrant |
699 | 708 |
*/ |
... | ... | |
711 | 720 |
free(rc); |
712 | 721 |
//TODO WHAT? |
713 | 722 |
} |
723 |
XSEGLOG2(&lc, I, "Finished\n"); |
|
714 | 724 |
return 0; |
715 | 725 |
} |
716 | 726 |
|
Also available in: Unified diff