xfs
[Top] [All Lists]

Re: [PATCH 7/8] xfs: factor common write setup code

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 7/8] xfs: factor common write setup code
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 10 Jan 2011 14:26:02 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1294399825-1157-8-git-send-email-david@xxxxxxxxxxxxx>
References: <1294399825-1157-1-git-send-email-david@xxxxxxxxxxxxx> <1294399825-1157-8-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Jan 07, 2011 at 10:30:24PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> The buffered IO and direct IO write paths share a common set of
> checks and limiting code prior to issuing the write. Factor that
> into a common helper function.
> 
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> Reviewed-by: Alex Elder <aelder@xxxxxxx>
> ---
>  fs/xfs/linux-2.6/xfs_file.c |  128 +++++++++++++++++++-----------------------
>  1 files changed, 58 insertions(+), 70 deletions(-)
> 
> diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
> index 9ce5e12..d6ff7ff 100644
> --- a/fs/xfs/linux-2.6/xfs_file.c
> +++ b/fs/xfs/linux-2.6/xfs_file.c
> @@ -620,6 +620,60 @@ out_lock:
>  }

> +     xfs_rw_ilock(ip, XFS_ILOCK_EXCL|*iolock);

it seems cleaner if we left this in the caller so that locking/unlocking
is not spread over N different layers.

Either way the patch looks correct, so:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

<Prev in Thread] Current Thread [Next in Thread>