Lines Matching refs:rss
145 RangeSinkState* rss = (RangeSinkState*) token;
147 if (rss->p_remain <= 0) {
155 if (rss->p_remain < write_now) write_now = rss->p_remain;
156 writeblock(rss->fd, data, write_now);
160 rss->p_remain -= write_now;
163 if (rss->p_remain == 0) {
165 ++rss->p_block;
166 if (rss->p_block < rss->tgt->count) {
167 rss->p_remain = (rss->tgt->pos[rss->p_block*2+1] - rss->tgt->pos[rss->p_block*2]) * BLOCKSIZE;
168 check_lseek(rss->fd, (off64_t)rss->tgt->pos[rss->p_block*2] * BLOCKSIZE, SEEK_SET);
197 // written, it sets rss to the destination location and signals the
199 // rss and signals the condition again.
205 RangeSinkState* rss;
215 // Wait for nti->rss to be non-NULL, indicating some of this
218 while (nti->rss == NULL) {
223 // At this point nti->rss is set, and we own it. The main
225 ssize_t written = RangeSinkWrite(data, size, nti->rss);
229 if (nti->rss->p_block == nti->rss->tgt->count) {
230 // we have written all the bytes desired by this rss.
233 nti->rss = NULL;
482 nti.rss = NULL;
638 RangeSinkState rss;
639 rss.fd = fd;
640 rss.tgt = tgt;
641 rss.p_block = 0;
642 rss.p_remain = (tgt->pos[1] - tgt->pos[0]) * BLOCKSIZE;
646 nti.rss = &rss;
648 while (nti.rss) {
683 RangeSinkState rss;
684 rss.fd = fd;
685 rss.tgt = tgt;
686 rss.p_block = 0;
687 rss.p_remain = (tgt->pos[1] - tgt->pos[0]) * BLOCKSIZE;
694 &RangeSinkWrite, &rss, NULL, NULL);
698 &RangeSinkWrite, &rss, NULL);
707 if (rss.p_block != tgt->count || rss.p_remain != 0) {