]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: preset set/get token with first page and drop condition
authorDavid Sterba <dsterba@suse.com>
Wed, 29 Apr 2020 17:29:04 +0000 (19:29 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:32 +0000 (11:25 +0200)
commit16533589f878045b9825535d58ea813b806a87c1
tree92610e2454cfc6c76928cbaa02a678e0ec1a0227
parente754aa38c6713e69b78ab8685c94ee1134166314
btrfs: preset set/get token with first page and drop condition

All the set/get helpers first check if the token contains a cached
address. After first use the address is always valid, but the extra
check is done for each call.

The token initialization can optimistically set it to the first extent
buffer page, that we know always exists. Then the condition in all
btrfs_token_*/btrfs_set_token_* can be simplified by removing the
address check from the condition, but for development the assertion
still makes sure it's valid.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/struct-funcs.c