From patchwork Fri May 7 17:41:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 97782 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 o47Hgf3L013260 for ; Fri, 7 May 2010 17:42:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756360Ab0EGRlw (ORCPT ); Fri, 7 May 2010 13:41:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1537 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755803Ab0EGRlv (ORCPT ); Fri, 7 May 2010 13:41:51 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o47Hf5BM031323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 7 May 2010 13:41:05 -0400 Received: from localhost.localdomain (vpn-9-238.rdu.redhat.com [10.11.9.238]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o47Hf4H6024443; Fri, 7 May 2010 13:41:05 -0400 Date: Fri, 7 May 2010 13:41:04 -0400 From: Josef Bacik To: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: hch@infradead.org, akpm@linux-foundation.org Subject: [PATCH 3/5] direct-io: honor dio->boundary a little more strictly Message-ID: <20100507174104.GD3360@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 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]); Fri, 07 May 2010 17:42:42 +0000 (UTC) diff --git a/fs/direct-io.c b/fs/direct-io.c index 2dbf2e9..98f6f42 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -615,6 +615,7 @@ static int dio_bio_add_page(struct dio *dio) */ static int dio_send_cur_page(struct dio *dio) { + int boundary = dio->boundary; int ret = 0; if (dio->bio) { @@ -627,7 +628,7 @@ static int dio_send_cur_page(struct dio *dio) * Submit now if the underlying fs is about to perform a * metadata read */ - if (dio->boundary) + if (boundary) dio_bio_submit(dio); } @@ -644,6 +645,8 @@ static int dio_send_cur_page(struct dio *dio) ret = dio_bio_add_page(dio); BUG_ON(ret != 0); } + } else if (boundary) { + dio_bio_submit(dio); } out: return ret;