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

Christoph Hellwig
2011-01-10T19:23:50Z

On Fri, Jan 07, 2011 at 10:30:24PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> 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@redhat.com>
> Reviewed-by: Alex Elder <aelder@sgi.com>
> ---
> 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@lst.de>