]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: replace readpage_end_io_hook with direct calls
authorNikolay Borisov <nborisov@suse.com>
Fri, 18 Sep 2020 13:34:33 +0000 (16:34 +0300)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:13:24 +0000 (12:13 +0200)
commit04293e3e76c5a904728555cad206415f73bee508
tree702cded90155569bd85205c468d7cf92e976bb2c
parentd9ba4bddc2798085ed207a593416cda83196f301
btrfs: replace readpage_end_io_hook with direct calls

Don't call readpage_end_io_hook for the btree inode.  Instead of relying
on indirect calls to implement metadata buffer validation simply check
if the inode whose page we are processing equals the btree inode. If it
does call the necessary function.

This is an improvement in 2 directions:

1. We aren't paying the penalty of indirect calls in a post-speculation
   attacks world.

2. The function is now named more explicitly so it's obvious what's
   going on

This is in preparation to removing struct extent_io_ops altogether.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/extent_io.c
fs/btrfs/inode.c