Repository navigation
Commit 5cd17f3
committed
btrfs: speed up and simplify generic_bin_search
The bin search jumps over the extent buffer item keys, comparing
directly the bytes if the key is in one page, or storing it in a
temporary buffer in case it spans two pages.
The mapping start and length are obtained from map_private_extent_buffer,
which is heavy weight compared to what we need. We know the key size and
can find out the eb page in a simple way. For keys spanning two pages
the fallback read_extent_buffer is used.
The temporary variables are reduced and moved to the scope of use.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent ce7afe8 commit 5cd17f3
1 file changed
Lines changed: 15 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1668 | 1668 | | |
1669 | 1669 | | |
1670 | 1670 | | |
1671 | | - | |
1672 | 1671 | | |
1673 | | - | |
1674 | | - | |
1675 | | - | |
1676 | | - | |
1677 | | - | |
1678 | | - | |
1679 | | - | |
| 1672 | + | |
1680 | 1673 | | |
1681 | 1674 | | |
1682 | 1675 | | |
| |||
1687 | 1680 | | |
1688 | 1681 | | |
1689 | 1682 | | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
1690 | 1689 | | |
1691 | 1690 | | |
| 1691 | + | |
1692 | 1692 | | |
1693 | | - | |
1694 | | - | |
1695 | | - | |
1696 | | - | |
1697 | | - | |
1698 | | - | |
1699 | | - | |
1700 | | - | |
1701 | | - | |
1702 | | - | |
1703 | | - | |
1704 | | - | |
1705 | | - | |
1706 | | - | |
1707 | | - | |
1708 | | - | |
1709 | | - | |
1710 | | - | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
1711 | 1696 | | |
| 1697 | + | |
1712 | 1698 | | |
1713 | | - | |
1714 | | - | |
| 1699 | + | |
| 1700 | + | |
1715 | 1701 | | |
| 1702 | + | |
1716 | 1703 | | |
1717 | 1704 | | |
1718 | 1705 | | |
| |||
0 commit comments