From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cn.fujitsu.com ([59.151.112.132]:41317 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753133AbcGUBSJ (ORCPT ); Wed, 20 Jul 2016 21:18:09 -0400 Subject: Re: [PATCH 3/4] btrfs: introduce new EXTENT_CLEAR_DATA_RESV flag To: Josef Bacik , References: <20160720055637.7275-1-wangxg.fnst@cn.fujitsu.com> <20160720055637.7275-4-wangxg.fnst@cn.fujitsu.com> <31d80e05-5e6d-7eba-3f7c-b436bc492c16@fb.com> CC: , From: Wang Xiaoguang Message-ID: <57902236.7040104@cn.fujitsu.com> Date: Thu, 21 Jul 2016 09:15:34 +0800 MIME-Version: 1.0 In-Reply-To: <31d80e05-5e6d-7eba-3f7c-b436bc492c16@fb.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Sender: linux-btrfs-owner@vger.kernel.org List-ID: hello, On 07/20/2016 09:22 PM, Josef Bacik wrote: > On 07/20/2016 01:56 AM, Wang Xiaoguang wrote: >> In next patch, btrfs_clear_bit_hook() will not call >> btrfs_free_reserved_data_space_noquota() to update btrfs_space_info's >> bytes_may_use unless it has EXTENT_DO_ACCOUNTING or >> EXTENT_CLEAR_DATA_RESV, >> as for the reason, please see the next patch for detailed info. >> >> As we know, usually EXTENT_DO_ACCOUNTING is used for error path. In >> run_delalloc_nocow(), for inode marked as NODATACOW or extent marked as >> PREALLOC, we also need to update bytes_may_use, but can not pass >> EXTENT_DO_ACCOUNTING, because it also clears metadata reservation, so >> here >> we introduce EXTENT_CLEAR_DATA_RESV flag to indicate >> btrfs_clear_bit_hook() >> to update btrfs_space_info's bytes_may_use. >> >> Signed-off-by: Wang Xiaoguang > > There's no point in introducing only a flag in one patch, collapse > this into the patch that actually uses it. Thanks, OK Regards, Xiaoguang Wang > > Josef > >