From e076d33bfa9a5ef334e8db6e143c624d15a7c30f Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 22 Feb 2006 13:23:30 +0100 Subject: [PATCH] [PATCH] blktrace: no need to track ts->offset anymore --- blktrace.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/blktrace.c b/blktrace.c index 306a736..24b48d5 100644 --- a/blktrace.c +++ b/blktrace.c @@ -160,7 +160,6 @@ struct tip_subbuf { void *buf; unsigned int len; unsigned int max_len; - off_t offset; }; #define FIFO_SIZE (1024) /* should be plenty big! */ @@ -597,13 +596,10 @@ static int get_subbuf_sendfile(struct thread_information *tip, ts->buf = NULL; ts->max_len = 0; - ts->offset = tip->ofile_offset; - if (subbuf_fifo_queue(tip, ts)) return -1; tip->sendfile_pending++; - tip->ofile_offset += buf_size; return buf_size; } @@ -807,7 +803,7 @@ static int flush_subbuf_sendfile(struct thread_information *tip, if (ts->buf) return flush_subbuf_net(tip, ts); - pad = get_subbuf_padding(tip, ts->offset); + pad = get_subbuf_padding(tip, tip->ofile_offset); if (pad == -1) goto err; @@ -819,6 +815,8 @@ static int flush_subbuf_sendfile(struct thread_information *tip, goto err; tip->data_read += ts->len; + tip->ofile_offset += buf_size; + ret = 0; err: tip->sendfile_pending--; free(ts); -- 2.25.1