btrfs: remove unused gfp mask parameter from release_extent_buffer callchain

It's unused since 0b32f4bbb423f02ac.

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs: read entire device info under lock

There's a theoretical possibility of reading stale (or even more
theoretically, freed) data from DEV_INFO ioctl when the device would
disappear between an early mutex unlock and data being copied from the
device structure.

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs: reduce btrfs_path size

Reduce size of struct btrfs_path from 144 to 96 bytes and save one
cacheline. This will allow packing of 42 objects into a PAGE_SIZE slab,
(previously 28, measured on x86_64).

Let 'slots' hold at most 65536, which is enough to index items for
reasonably big blocksizes (4k, 64k).
Maximum is 2M: 65536 * 33 (sizeof struct btrfs_key_ptr)

(Making it u8 would allow only 256 * 33 = 8448 ie 8k blocksize)

A 'locks' item holds at most 5 values of lock type.

'lowest_level': maximum level is 8

The 'reada' is set to {-1,0,1,2}, has to be signed.

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs: use only memmove_extent_buffer and simplify the helpers

After commit a65917156e34594 ("Btrfs: stop using highmem for
extent_buffers") we don't need to call kmap_atomic anymore and can
reduce the move_pages helper to a simple memmove.

There's only one caller of memcpy_extent_buffer, we can use the
memmove_ variant here.

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs: use unsigned long type for extent state bits

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs: fix misleading variable name for flags

The variable was named 'data' in btrfs_reserve_extent and that's the
only function that actually uses it to let btrfs_get_alloc_profile know
what profile we want. Then it's passed down as u64 flags.

Signed-off-by: David Sterba <dsterba@suse.cz>
Revert "btrfs: reduce btrfs_path size"

This reverts commit a49fd3bf54caeb1f55e0b694e4fd4b5b442a5a56.