Re: Questions about FIEMAP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 12, 2015 at 04:37:55AM +0000, Wang, Zhiye wrote:
> After googled a bit, I got information that btrfs supports FIEMAP (as
> "cp" needs it), but it's not valid for "write" operation.

The FIEMAP output is informative, there's no guarantee that the extent
information does not change before it reaches the caller.

> I guess we cannot write to block device directly after get block list
> using FIEMAP.

Beware that there's another layer of translation that maps the logical
offsets to physical offsets, basically the RAID layer. So even if you
get 'physical offset' from FIEMAP, it's still the 'logical' offset from
the POV of the filesytem and has no correspondence to the block device
offset.

> This is because:
> 
> 1. COW feature of btrfs (but this can be disabled using NOCOW)
> 2. File system rebalance
> 3. Defragmentation

This always reflects the 'logical' offset from the filesystem POV.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux