btrfs: always return the largest hole possible for btrfs_get_extent()
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | btrfs: return the largest hole between two file extent itemsfs/ | +0 | 2 replies | |
| 2/3 | btrfs: refactor hole cases of btrfs_get_extent()fs/ | +30 | 0 replies | |
| 3/3 | btrfs: return the largest possible hole for EOF casesfs/ | +18 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] btrfs: always return the largest hole possible for btrfs_get_extent()
When looking in the call sites of btrfs_get_extent(), I didn't really see the need of @len parameter, as normally btrfs_get_extent() would just return the hole or the regular file extent covering @start.
And it turns out that @len is not really that much used in btrfs_get_extent().
If we find a regular/inline/prealloc file extent, we just return the full extent map from that file extent.
It's only for implied holes (aka, NO-HOLES feature where there is no explicit file extent item for a hole) that @len makes a difference.
But in that case, we can simply return the largest hole possible (either the range between two file extents, or for beyond EOF cases return hole covering the largest possible file size).
Patch 1 is removing a hole size truncation, which in theory can benefit readahead on a large hole (no extra tree search for the hole again and again).
Patch 2 is a refactor to remove a weird code pattern.
Patch 3 is to make beyond EOF cases to return the largest hole possible (covering the max file size), so that we won't really utilize @len for hole extent map creation.
Qu Wenruo (3):
btrfs: return the largest hole between two file extent items
btrfs: refactor hole cases of btrfs_get_extent()
btrfs: return the largest possible hole for EOF cases
fs/btrfs/inode.c | 66 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 21 deletions(-)
Signature · 1 line
2.52.0