Ah okay, I now see how it works. Thanks a lot for your response.

Regards,
Aastha.


On 25 February 2013 18:27, Josef Bacik <jba...@fusionio.com> wrote:
> On Mon, Feb 25, 2013 at 08:15:40AM -0700, Aastha Mehta wrote:
>> Thanks again Josef.
>>
>> I understood that cow_file_range is called for a regular file. Just to
>> clarify, in cow_file_range is cow done at the time of reserving
>> extents in the extent btree for the io to be done in this delalloc? I
>> see the following comment above find_free_extent() which is called
>> while trying to reserve extents:
>>
>> /*
>>  * walks the btree of allocated extents and find a hole of a given size.
>>  * The key ins is changed to record the hole:
>>  * ins->objectid == block start
>>  * ins->flags = BTRFS_EXTENT_ITEM_KEY
>>  * ins->offset == number of blocks
>>  * Any available blocks before search_start are skipped.
>>  */
>>
>> This seems to be the only place where a cow might be done, because a
>> key is being inserted into an extent which modifies it.
>>
>
> The key isn't inserted at this time, it's just returned with those values for 
> us
> to do as we please.  There is no update of the btree until
> insert_reserved_extent/btrfs_mark_extent_written in btrfs_finish_ordered_io.
> Thanks,
>
> Josef
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to