xfs
[Top] [All Lists]

Re: vfs/xfs: directio updates to ease COW handling V2

To: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>
Subject: Re: vfs/xfs: directio updates to ease COW handling V2
From: Jeff Moyer <jmoyer@xxxxxxxxxx>
Date: Wed, 03 Feb 2016 16:53:04 -0500
Cc: Christoph Hellwig <hch@xxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, ocfs2-devel@xxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160203200159.GK20038@xxxxxxxxxxxxxxxx> (Darrick J. Wong's message of "Wed, 3 Feb 2016 12:01:59 -0800")
References: <1454524816-11392-1-git-send-email-hch@xxxxxx> <x49zivhy3zt.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20160203200159.GK20038@xxxxxxxxxxxxxxxx>
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
"Darrick J. Wong" <darrick.wong@xxxxxxxxxx> writes:

> On Wed, Feb 03, 2016 at 02:43:02PM -0500, Jeff Moyer wrote:
>> Hi, Christoph,
>> 
>> Can you explain a bit what you mean by easing COW handling?  Whenever I
>> see COW referenced near DIO, my mind always turns to g_u_p vs. fork.
>
> Just to clarify, I'm talking about copy on write for disk blocks, not for
> memory pages.
>
> Basically, XFS implements (disk block) copy on write for (perfectly block
> aligned) directio writes by allocating a set of replacement blocks, mapping 
> the
> dio writes to the new blocks, and playing a punch/remap trick to map the new
> blocks into the file at the appropriate offset.
>
> If the write fails then we don't want do the remap, so the dio_complete 
> handler
> has to know whether or not the IO succeeded, hence the new parameter.
> Furthermore, if the write succeeds but the remap fails, we also want to be 
> able
> to report that to userspace, hence the change of return value from void to 
> int.
>
> (If the dio write isn't block aligned, we fall back to the page cache.)
>
> Hope that helps,

Eric said the magic word: reflink.  I think I've got it now.

Thanks!
Jeff

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