xfs
[Top] [All Lists]

Re: [PATCH 2/8] xfs: factor common post-write isize handling code

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/8] xfs: factor common post-write isize handling code
From: Alex Elder <aelder@xxxxxxx>
Date: Tue, 04 Jan 2011 19:54:14 -0600
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1294116518-14908-3-git-send-email-david@xxxxxxxxxxxxx>
References: <1294116518-14908-1-git-send-email-david@xxxxxxxxxxxxx> <1294116518-14908-3-git-send-email-david@xxxxxxxxxxxxx>
Reply-to: aelder@xxxxxxx
On Tue, 2011-01-04 at 15:48 +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 

With one exception noted below, this looks good.

Reviewed-by: Alex Elder <aelder@xxxxxxx>

> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> ---
>  fs/xfs/linux-2.6/xfs_file.c |   52 +++++++++++++++++++++++-------------------
>  1 files changed, 28 insertions(+), 24 deletions(-)

. . .

> @@ -742,16 +755,7 @@ write_retry:
>  
>       current->backing_dev_info = NULL;
>  
> -     isize = i_size_read(inode);
> -     if (unlikely(ret < 0 && ret != -EFAULT && iocb->ki_pos > isize))
> -             iocb->ki_pos = isize;
> -
> -     if (iocb->ki_pos > ip->i_size) {
> -             xfs_ilock(ip, XFS_ILOCK_EXCL);
> -             if (iocb->ki_pos > ip->i_size)
> -                     ip->i_size = iocb->ki_pos;
> -             xfs_iunlock(ip, XFS_ILOCK_EXCL);
> -     }
> +     xfs_aio_write_isize_update(inode, &iocb->ki_pos, ret);
>  
>       if (ret <= 0)
>               goto out_unlock_internal;

Just below this point in the original code there is a
call to XFS_STATS_ADD(xs_write_bytes, ret); that also
needs to be removed, because xfs_aio_write_isize_update()
now does it for you.


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