Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754169Ab2JBSoM (ORCPT ); Tue, 2 Oct 2012 14:44:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13020 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752933Ab2JBSoJ (ORCPT ); Tue, 2 Oct 2012 14:44:09 -0400 Date: Tue, 2 Oct 2012 14:43:59 -0400 From: Vivek Goyal To: Kent Overstreet Cc: linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, tj@kernel.org, axboe@kernel.dk Subject: Re: [dm-devel] [PATCH v3 04/26] block: Refactor blk_update_request() Message-ID: <20121002184359.GC3283@redhat.com> References: <1348526106-17074-1-git-send-email-koverstreet@google.com> <1348526106-17074-5-git-send-email-koverstreet@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1348526106-17074-5-git-send-email-koverstreet@google.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1661 Lines: 45 On Mon, Sep 24, 2012 at 03:34:44PM -0700, Kent Overstreet wrote: > Converts it to use bio_advance(), simplifying it quite a bit in the > process. > > Note that req_bio_endio() now always calls bio_advance() - which means > it always loops over the biovec, not just on partial completions. Don't > expect it to affect performance, but worth noting. > > Tested it by forcing partial updates, and dumping before and after on > various bio/bvec fields when doing a partial update. > > Signed-off-by: Kent Overstreet > CC: Jens Axboe > --- > block/blk-core.c | 80 +++++++++----------------------------------------------- > 1 file changed, 12 insertions(+), 68 deletions(-) > > diff --git a/block/blk-core.c b/block/blk-core.c > index a17869f..a8a1a9e 100644 > --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -158,20 +158,10 @@ static void req_bio_endio(struct request *rq, struct bio *bio, > else if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) > error = -EIO; > > - if (unlikely(nbytes > bio->bi_size)) { > - printk(KERN_ERR "%s: want %u bytes done, %u left\n", > - __func__, nbytes, bio->bi_size); > - nbytes = bio->bi_size; > - } > - You are dropping this warning because nobody is calling req_bio_endio() with bytes greater than bio size in current code? Otherwise this looks like a good simplification of blk_update_request() code. Thanks Vivek -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/