]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: send: avoid copying file data
authorOmar Sandoval <osandov@fb.com>
Fri, 21 Aug 2020 07:39:52 +0000 (00:39 -0700)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:13:17 +0000 (12:13 +0200)
commit0c5aacd8c14efeac983aa10326a6b36777d84b83
tree0a4f7cfc7e9671dd2c2a4b81a3b528bbbb91ea28
parent6ccef26102e0407e1f776ba7a01894b2535ade90
btrfs: send: avoid copying file data

send_write() currently copies from the page cache to sctx->read_buf, and
then from sctx->read_buf to sctx->send_buf. Similarly, send_hole()
zeroes sctx->read_buf and then copies from sctx->read_buf to
sctx->send_buf. However, if we write the TLV header manually, we can
copy to sctx->send_buf directly and get rid of sctx->read_buf.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/send.c
fs/btrfs/send.h