summaryrefslogtreecommitdiff
path: root/drivers/platform/mellanox
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2020-04-29 18:07:04 +0200
committerDavid Sterba <dsterba@suse.com>2020-05-25 11:25:33 +0200
commit029e4a42a2b22f3c82e5b325820219963aa3f13b (patch)
tree9623defc0b64bc5e66778bdec4b57696563074b0 /drivers/platform/mellanox
parent8f9da810ee1fac6b587e3b871ee73696906bcba3 (diff)
btrfs: speed up btrfs_set_##bits helpers
The helpers unconditionally call map_private_extent_buffer to get the address of page containing the requested offset plus the mapping start and length. Depending on the return value, the fast path uses unaligned put to write data within a page, or fall back to write_extent_buffer that can handle writes spanning more pages. This is all wasteful. We know the number of bytes to write, 1/2/4/8 and can find out the page. Then simply check if it's contained or the fallback is needed. This saves one function call to map_private_extent_buffer and several unnecessary temporary variables. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'drivers/platform/mellanox')
0 files changed, 0 insertions, 0 deletions