Lines Matching defs:piece
576 pieceHasFile( tr_piece_index_t piece,
579 return ( file->firstPiece <= piece ) && ( piece <= file->lastPiece );
584 tr_piece_index_t piece,
590 /* find the first file that has data in this piece */
593 while( i > 0 && pieceHasFile( piece, &tor->info.files[i - 1] ) )
597 if( pieceHasFile( piece, &tor->info.files[i] ) )
601 /* the piece's priority is the max of the priorities
602 * of all the files in that piece */
607 if( !pieceHasFile( piece, file ) )
616 if( file->firstPiece == piece || file->lastPiece == piece )
1247 /* etaXLSpeed exists because if we use the piece speed directly,
1249 * so, etaXLSpeed is a smoothed-out version of the piece speed
2197 /* can't set the first piece to DND unless
2198 every file using that piece is DND */
2212 /* can't set the last piece to DND unless
2213 every file using that piece is DND */
2332 tr_piece_index_t * piece,
2338 *piece = pos / tor->info.pieceSize;
2339 *offset = pos - ( *piece * tor->info.pieceSize );
2425 const tr_piece_index_t piece,
2430 offset *= piece;
2432 offset += ( tr_torPieceCountBytes( tor, piece ) - 1 );
2466 tr_deeplog_tor( tor, "[LAZY] tr_torrentCheckPiece tested piece %zu, pass==%d", (size_t)pieceIndex, (int)pass );
2491 /* if we've never checked this piece, then it needs to be checked */
2495 /* If we think we've completed one of the files in this piece,