btrfs: add comments for btrfs_map_block()
authorQu Wenruo <wqu@suse.com>
Tue, 27 Jun 2023 07:34:31 +0000 (15:34 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Aug 2023 12:52:12 +0000 (14:52 +0200)
commited3764f726b24099396734aa1a5b41ae7e0fac60
treed7b6cb0051189e5c3779c31a4810b2e8428f0701
parent966de47ff0c9e64d74e1719e4480b7c34f6190fa
btrfs: add comments for btrfs_map_block()

The function btrfs_map_block() is a critical part of the btrfs storage
layer, which handles mapping of logical ranges to physical ranges.

Thus it's better to have some basic explanation, especially on the
following points:

- Segment split by various boundaries
  As a continuous logical range may be split into different segments,
  due to various factors like zones and RAID0/5/6/10 boundaries.

- The meaning of @mirror_num

- The possible single stripe optimization

- One deprecated parameter @need_raid_map
  Just explicitly mark it deprecated so we're aware of the problem.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c