mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 15:15:47 +00:00
Btrfs: avoid unnecessary utimes update in incremental send
When we're finishing processing of an inode, if we're dealing with a directory inode that has a pending move/rename operation, we don't need to send a utimes update instruction to the send stream, as we'll do it later after doing the move/rename operation. Therefore we save some time here building paths and doing btree lookups. Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Signed-off-by: Josef Bacik <jbacik@fb.com>
This commit is contained in:
parent
e2127cf008
commit
fcbd2154d1
1 changed files with 11 additions and 10 deletions
|
@ -4957,18 +4957,19 @@ static int finish_inode_if_needed(struct send_ctx *sctx, int at_end)
|
||||||
ret = apply_children_dir_moves(sctx);
|
ret = apply_children_dir_moves(sctx);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
/*
|
||||||
|
* Need to send that every time, no matter if it actually
|
||||||
|
* changed between the two trees as we have done changes to
|
||||||
|
* the inode before. If our inode is a directory and it's
|
||||||
|
* waiting to be moved/renamed, we will send its utimes when
|
||||||
|
* it's moved/renamed, therefore we don't need to do it here.
|
||||||
|
*/
|
||||||
|
sctx->send_progress = sctx->cur_ino + 1;
|
||||||
|
ret = send_utimes(sctx, sctx->cur_ino, sctx->cur_inode_gen);
|
||||||
|
if (ret < 0)
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Need to send that every time, no matter if it actually
|
|
||||||
* changed between the two trees as we have done changes to
|
|
||||||
* the inode before.
|
|
||||||
*/
|
|
||||||
sctx->send_progress = sctx->cur_ino + 1;
|
|
||||||
ret = send_utimes(sctx, sctx->cur_ino, sctx->cur_inode_gen);
|
|
||||||
if (ret < 0)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue