From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Moyer Subject: Re: [PATCH 6/8] dio: add an entry point which takes pages Date: Tue, 27 Oct 2009 11:49:42 -0400 Message-ID: References: <1256243157-16667-1-git-send-email-zach.brown@oracle.com> <1256243157-16667-2-git-send-email-zach.brown@oracle.com> <1256243157-16667-3-git-send-email-zach.brown@oracle.com> <1256243157-16667-4-git-send-email-zach.brown@oracle.com> <1256243157-16667-5-git-send-email-zach.brown@oracle.com> <1256243157-16667-6-git-send-email-zach.brown@oracle.com> <1256243157-16667-7-git-send-email-zach.brown@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Zach Brown Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37720 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755602AbZJ0Ptl (ORCPT ); Tue, 27 Oct 2009 11:49:41 -0400 In-Reply-To: <1256243157-16667-7-git-send-email-zach.brown@oracle.com> (Zach Brown's message of "Thu, 22 Oct 2009 13:25:55 -0700") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Zach Brown writes: > This adds a high level entry point into the direct-io code which calls helpers > on memory specified by pages instead of iovecs. > > curr_user_address is used to decide if we should be dirtying the memory pages. > In our case, we don't want to. > > The trick here is to initialize the dio state so that do_direct_IO() consumes > the pages we provide and never tries to map user pages. This is done by making > sure that final_block_in_request covers all the pages we provide. Looks sane, in general. > - if (dio->is_async && dio->rw == READ) > + if (dio->is_async && dio->rw == READ && dio->curr_user_address) Any chance we can factor this check out into a macro or some such thing? It's repeated several times. Cheers, Jeff