From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikolay Borisov Subject: Re: [RFC PATCH v3 09/12] btrfs: support different disk extent size for delalloc Date: Wed, 27 Nov 2019 12:33:21 +0200 Message-ID: <0df9fd0a-e0d1-c8c1-6e2c-d831a20478ce@suse.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-btrfs-owner@vger.kernel.org To: Omar Sandoval , linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org Cc: Dave Chinner , Jann Horn , Amir Goldstein , Aleksa Sarai , linux-api@vger.kernel.org, kernel-team@fb.com List-Id: linux-api@vger.kernel.org On 20.11.19 г. 20:24 ч., Omar Sandoval wrote: > From: Omar Sandoval > > Currently, we always reserve the same extent size in the file and extent > size on disk for delalloc because the former is the worst case for the > latter. For RWF_ENCODED writes, we know the exact size of the extent on > disk, which may be less than or greater than (for bookends) the size in > the file. Add a disk_num_bytes parameter to > btrfs_delalloc_reserve_metadata() so that we can reserve the correct > amount of csum bytes. Additionally, make > btrfs_free_reserve_data_space_noquota() take a number of bytes instead > of a range, as it refers to the extent size on disk, not in the file. No > functional change. > > Signed-off-by: Omar Sandoval Reviewed-by: Nikolay Borisov