From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Moyer Subject: Re: [PATCH 5/8] dio: refactor __blockdev_direct_IO() Date: Tue, 27 Oct 2009 11:39:02 -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> 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]:7859 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755502AbZJ0PjB (ORCPT ); Tue, 27 Oct 2009 11:39:01 -0400 In-Reply-To: <1256243157-16667-6-git-send-email-zach.brown@oracle.com> (Zach Brown's message of "Thu, 22 Oct 2009 13:25:54 -0700") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Zach Brown writes: > This patch moves code around so that __blockdev_direct_IO() becomes a function > which only iterates over its iovec argument while calling helper functions. > This wil let us add functions in the future which call the same helper > functions while iterating over other ways of specifying memory for the IO. > > direct_io_worker() was only called once from __blockdev_direct_IO() but took > the iovec argument. Instead of trying to pass down other ways of specifying > memory, we move its body up into __blockdev_direct_IO() before pulling the > initilization and teardown steps of this resulting huge function off into > helpers. What's left is a small function that mostly concerns itself with > calling helpers on the iovec. > > The dio_unaligned() helper is a little strange, but it reflects the flow of the > original code. If we were to clean it up we'd run the risk of introducing > bugs. > > Comments have not been updated to reflect the code change yet. Wow, that's a dense patch. It looks right to me, and I like the cleanup. Cheers, Jeff