diff options
author | Filipe Manana <fdmanana@gmail.com> | 2014-03-03 07:28:40 -0500 |
---|---|---|
committer | Josef Bacik <jbacik@fb.com> | 2014-03-10 15:17:18 -0400 |
commit | fcbd2154d16431395e86a48859a5b547c33c09ad (patch) | |
tree | 0e99d795e6ff65abb5b923e5d5adf1113da50691 /fs/btrfs/send.c | |
parent | e2127cf008be01c6aa9db463470c0668a85d6fe4 (diff) |
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>
Diffstat (limited to 'fs/btrfs/send.c')
-rw-r--r-- | fs/btrfs/send.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index c2522e4e2c59..9d057ef5adef 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
@@ -4957,18 +4957,19 @@ static int finish_inode_if_needed(struct send_ctx *sctx, int at_end) | |||
4957 | ret = apply_children_dir_moves(sctx); | 4957 | ret = apply_children_dir_moves(sctx); |
4958 | if (ret) | 4958 | if (ret) |
4959 | goto out; | 4959 | goto out; |
4960 | /* | ||
4961 | * Need to send that every time, no matter if it actually | ||
4962 | * changed between the two trees as we have done changes to | ||
4963 | * the inode before. If our inode is a directory and it's | ||
4964 | * waiting to be moved/renamed, we will send its utimes when | ||
4965 | * it's moved/renamed, therefore we don't need to do it here. | ||
4966 | */ | ||
4967 | sctx->send_progress = sctx->cur_ino + 1; | ||
4968 | ret = send_utimes(sctx, sctx->cur_ino, sctx->cur_inode_gen); | ||
4969 | if (ret < 0) | ||
4970 | goto out; | ||
4960 | } | 4971 | } |
4961 | 4972 | ||
4962 | /* | ||
4963 | * Need to send that every time, no matter if it actually | ||
4964 | * changed between the two trees as we have done changes to | ||
4965 | * the inode before. | ||
4966 | */ | ||
4967 | sctx->send_progress = sctx->cur_ino + 1; | ||
4968 | ret = send_utimes(sctx, sctx->cur_ino, sctx->cur_inode_gen); | ||
4969 | if (ret < 0) | ||
4970 | goto out; | ||
4971 | |||
4972 | out: | 4973 | out: |
4973 | return ret; | 4974 | return ret; |
4974 | } | 4975 | } |