btrfs: define separate btrfs_set/get_XX helpers
authorDavid Sterba <dsterba@suse.com>
Fri, 9 Aug 2019 15:12:38 +0000 (17:12 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:16 +0000 (14:59 +0200)
commitcb49511328dcce73840a54661622950d7fa6384e
treea380d0eb8fd8d8174502b0a415879765809e988b
parent6ff49c6ad285160b8ba48589ebdbf6cebdd42f74
btrfs: define separate btrfs_set/get_XX helpers

There are helpers for all type widths defined via macro and optionally
can use a token which is a cached pointer to avoid repeated mapping of
the extent buffer.

The token value is known at compile time, when it's valid it's always
address of a local variable, otherwise it's NULL passed by the
token-less helpers.

This can be utilized to remove some branching as the helpers are used
frequenlty.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/struct-funcs.c