Commit c715e155 authored by Filipe Manana's avatar Filipe Manana Committed by Chris Mason

Btrfs: send, build path string only once in send_hole

There's no point building the path string in each iteration of the
send_hole loop, as it produces always the same string.
Signed-off-by: default avatarFilipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 9a40f122
...@@ -4436,14 +4436,14 @@ static int send_hole(struct send_ctx *sctx, u64 end) ...@@ -4436,14 +4436,14 @@ static int send_hole(struct send_ctx *sctx, u64 end)
p = fs_path_alloc(); p = fs_path_alloc();
if (!p) if (!p)
return -ENOMEM; return -ENOMEM;
ret = get_cur_path(sctx, sctx->cur_ino, sctx->cur_inode_gen, p);
if (ret < 0)
goto tlv_put_failure;
memset(sctx->read_buf, 0, BTRFS_SEND_READ_SIZE); memset(sctx->read_buf, 0, BTRFS_SEND_READ_SIZE);
while (offset < end) { while (offset < end) {
len = min_t(u64, end - offset, BTRFS_SEND_READ_SIZE); len = min_t(u64, end - offset, BTRFS_SEND_READ_SIZE);
ret = begin_cmd(sctx, BTRFS_SEND_C_WRITE); ret = begin_cmd(sctx, BTRFS_SEND_C_WRITE);
if (ret < 0)
break;
ret = get_cur_path(sctx, sctx->cur_ino, sctx->cur_inode_gen, p);
if (ret < 0) if (ret < 0)
break; break;
TLV_PUT_PATH(sctx, BTRFS_SEND_A_PATH, p); TLV_PUT_PATH(sctx, BTRFS_SEND_A_PATH, p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment