xfs
[Top] [All Lists]

Re: [PATCH v5 2/10] xfs: Add support FALLOC_FL_COLLAPSE_RANGE for falloc

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH v5 2/10] xfs: Add support FALLOC_FL_COLLAPSE_RANGE for fallocate
From: Namjae Jeon <linkinjeon@xxxxxxxxx>
Date: Mon, 24 Feb 2014 10:12:34 +0900
Cc: viro@xxxxxxxxxxxxxxxxxx, bpm@xxxxxxx, tytso@xxxxxxx, adilger.kernel@xxxxxxxxx, jack@xxxxxxx, mtk.manpages@xxxxxxxxx, lczerner@xxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Namjae Jeon <namjae.jeon@xxxxxxxxxxx>, Ashish Sangwan <a.sangwan@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=d3TIHNqSmCILrZxjkbBUy3EI0AgEgfYT38cqz3nckCE=; b=Ftsgn6kroduOZv6eOhOkdEk5hbljzQRBtsyXB6JgeFYwJbR9ZXPWibr00CXKndo0YX 4i2NP+wdwEWdSqRMco0kGA7dxB9gpenC36+4NvCcL/hHgOiKsf6ZWpjyxtKMWnZSKJte 2UYAfyF+p8YnpmzW33MxVRYXMS4kNjFO+SkxzXz8LlwIrHiNJVesNfkSyawdlOMV/NLe OPVUmk5jdJ2PFJ2syvn+iOOFVP6CRZrM3RydjwNbakWA7VKGyLbPYHLtO/kMpmOa3KWv ApFu4iUG+Tw4vFcYowCBVf2DcdmuZqTbfeZHrd2sAB7aUlhtrLI8nosVR0gal5Xi/uO1 uLpQ==
In-reply-to: <20140223212231.GD4317@dastard>
References: <1392741475-20063-1-git-send-email-linkinjeon@xxxxxxxxx> <20140223212231.GD4317@dastard>
2014-02-24 6:22 GMT+09:00, Dave Chinner <david@xxxxxxxxxxxxx>:
> On Wed, Feb 19, 2014 at 01:37:55AM +0900, Namjae Jeon wrote:
>> From: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
>>
>> This patch implements fallocate's FALLOC_FL_COLLAPSE_RANGE for XFS.
>>
>> The semantics of this flag are following:
>> 1) It collapses the range lying between offset and length by removing any
>> data
>>    blocks which are present in this range and than updates all the
>> logical
>>    offsets of extents beyond "offset + len" to nullify the hole created
>> by
>>    removing blocks. In short, it does not leave a hole.
>> 2) It should be used exclusively. No other fallocate flag in combination.
>> 3) Offset and length supplied to fallocate should be fs block size
>> aligned
>>    in case of xfs and ext4.
>> 4) Collaspe range does not work beyond i_size.
>>
>> Signed-off-by: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
>> Signed-off-by: Ashish Sangwan <a.sangwan@xxxxxxxxxxx>
> .....
>> +    while (!error && !done) {
>> +            tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT);
>> +            tp->t_flags |= XFS_TRANS_RESERVE;
>
Hi Dave.
> This probably shouldn't use XFS_TRANS_RESERVE. If we are at ENOSPC,
> then the operation simply fails. Yes, we've already punched the
> hole, so we shouldn't get ENOSPC here, but I don't think it's worth
> dipping into the reserve pool as it has much more important uses...
Okay.
>
> You don' tneed to resent the entire patch for this - I can remove it
> directly myself....
Thanks very much for your help!!
>
> Otherwise it looks good, so consider it
>
> Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
>
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@xxxxxxxxxxxxx
>

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