From patchwork Wed Feb 3 18:18:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Mason X-Patchwork-Id: 76762 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o13IJa9p010088 for ; Wed, 3 Feb 2010 18:19:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753976Ab0BCSTf (ORCPT ); Wed, 3 Feb 2010 13:19:35 -0500 Received: from rcsinet11.oracle.com ([148.87.113.123]:18866 "EHLO rcsinet11.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752951Ab0BCSTe (ORCPT ); Wed, 3 Feb 2010 13:19:34 -0500 Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet11.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o13IJS5a005780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Feb 2010 18:19:30 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o136Xccc021930; Wed, 3 Feb 2010 18:19:28 GMT Received: from abhmt013.oracle.com by acsmt355.oracle.com with ESMTP id 9348621265221127; Wed, 03 Feb 2010 10:18:47 -0800 Received: from localhost (/66.66.148.185) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 03 Feb 2010 10:18:46 -0800 Date: Wed, 3 Feb 2010 13:18:45 -0500 From: Chris Mason To: Shaohua Li Cc: linux-btrfs@vger.kernel.org, jens.axboe@oracle.com Subject: Re: [patch]btrfs: finish read pages in the order they are submitted Message-ID: <20100203181845.GE22119@think> Mail-Followup-To: Chris Mason , Shaohua Li , linux-btrfs@vger.kernel.org, jens.axboe@oracle.com References: <20100203074511.GA26548@sli10-desk.sh.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100203074511.GA26548@sli10-desk.sh.intel.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Source-IP: acsmt355.oracle.com [141.146.40.155] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090201.4B69BE30.0099:SCFMA4539814,ss=1,fgs=0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 03 Feb 2010 18:19:36 +0000 (UTC) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 96577e8..4df0c56 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1750,7 +1750,8 @@ static void end_bio_extent_writepage(struct bio *bio, int err) static void end_bio_extent_readpage(struct bio *bio, int err) { int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); - struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1; + struct bio_vec *bvec_end = bio->bi_io_vec + bio->bi_vcnt - 1; + struct bio_vec *bvec = bio->bi_io_vec; struct extent_io_tree *tree; u64 start; u64 end; @@ -1773,7 +1774,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err) else whole_page = 0; - if (--bvec >= bio->bi_io_vec) + if (++bvec <= bvec_end) prefetchw(&bvec->bv_page->flags); if (uptodate && tree->ops && tree->ops->readpage_end_io_hook) { @@ -1818,7 +1819,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err) } check_page_locked(tree, page); } - } while (bvec >= bio->bi_io_vec); + } while (bvec <= bvec_end); bio_put(bio); }