On Thu, Oct 15, 2020 at 03:31:26PM +0530, Chandan Babu R wrote: > How about following the traits of XFS_IEXT_WRITE_UNWRITTEN_CNT (writing > to unwritten extent) and XFS_IEXT_REFLINK_END_COW_CNT (moving an extent > from cow fork to data fork) and setting XFS_IEXT_REFLINK_REMAP_CNT to a > worst case value of 2? A write spanning the entirety of an unwritten extent > does not change the extent count. Similarly, If there are no extents in the > data fork spanning the file range mapped by an extent in the cow > fork, moving the extent from cow fork to data fork increases the extent count > by just 1 and not by the worst case count of 2. No, I think the dynamic value is perfectly fine, as we have all the information trivially available. I just don't think having a separate macro and the comment explaining it away from the actual functionality is helpful.