fs: btrfs: Crossport btrfs_search_slot() from btrfs-progs
authorQu Wenruo <wqu@suse.com>
Wed, 24 Jun 2020 16:02:59 +0000 (18:02 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 8 Sep 2020 00:57:27 +0000 (20:57 -0400)
commit29c26ae8bcae9a6e03012c3c2398c0e7edc69a16
tree067c018c17b6b34c9c945673b2d4b0faf456a757
parentbccee8bcb2b5fffd4a81f99cd340af8bef494a5e
fs: btrfs: Crossport btrfs_search_slot() from btrfs-progs

This patch copies the core function, btrfs_search_slot(), from
btrfs-progs.

This version has the following functionality removed:
- The ability to COW tree block
  Related code is commented out, and can be enabled in the future.

- The readahead functionality
  This is abused in kernel. Remove it completely.

With the core function in place, btrfs developers should feel at home now.

This also crossports supporting code like btrfs_previous_item() to
ctree.[ch].

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Marek BehĂșn <marek.behun@nic.cz>
fs/btrfs/ctree.c
fs/btrfs/ctree.h