Commit 9555e1f1 authored by David Sterba's avatar David Sterba

btrfs: send: use boolean types for current inode status

The new, new_gen and deleted indicate a status, use boolean type instead
of int.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent cec3dad9
...@@ -118,14 +118,14 @@ struct send_ctx { ...@@ -118,14 +118,14 @@ struct send_ctx {
*/ */
u64 cur_ino; u64 cur_ino;
u64 cur_inode_gen; u64 cur_inode_gen;
int cur_inode_new;
int cur_inode_new_gen;
int cur_inode_deleted;
u64 cur_inode_size; u64 cur_inode_size;
u64 cur_inode_mode; u64 cur_inode_mode;
u64 cur_inode_rdev; u64 cur_inode_rdev;
u64 cur_inode_last_extent; u64 cur_inode_last_extent;
u64 cur_inode_next_write_offset; u64 cur_inode_next_write_offset;
bool cur_inode_new;
bool cur_inode_new_gen;
bool cur_inode_deleted;
bool ignore_cur_inode; bool ignore_cur_inode;
u64 send_progress; u64 send_progress;
...@@ -6482,7 +6482,7 @@ static int changed_inode(struct send_ctx *sctx, ...@@ -6482,7 +6482,7 @@ static int changed_inode(struct send_ctx *sctx,
close_current_inode(sctx); close_current_inode(sctx);
sctx->cur_ino = key->objectid; sctx->cur_ino = key->objectid;
sctx->cur_inode_new_gen = 0; sctx->cur_inode_new_gen = false;
sctx->cur_inode_last_extent = (u64)-1; sctx->cur_inode_last_extent = (u64)-1;
sctx->cur_inode_next_write_offset = 0; sctx->cur_inode_next_write_offset = 0;
sctx->ignore_cur_inode = false; sctx->ignore_cur_inode = false;
...@@ -6523,7 +6523,7 @@ static int changed_inode(struct send_ctx *sctx, ...@@ -6523,7 +6523,7 @@ static int changed_inode(struct send_ctx *sctx,
*/ */
if (left_gen != right_gen && if (left_gen != right_gen &&
sctx->cur_ino != BTRFS_FIRST_FREE_OBJECTID) sctx->cur_ino != BTRFS_FIRST_FREE_OBJECTID)
sctx->cur_inode_new_gen = 1; sctx->cur_inode_new_gen = true;
} }
/* /*
...@@ -6555,8 +6555,8 @@ static int changed_inode(struct send_ctx *sctx, ...@@ -6555,8 +6555,8 @@ static int changed_inode(struct send_ctx *sctx,
if (result == BTRFS_COMPARE_TREE_NEW) { if (result == BTRFS_COMPARE_TREE_NEW) {
sctx->cur_inode_gen = left_gen; sctx->cur_inode_gen = left_gen;
sctx->cur_inode_new = 1; sctx->cur_inode_new = true;
sctx->cur_inode_deleted = 0; sctx->cur_inode_deleted = false;
sctx->cur_inode_size = btrfs_inode_size( sctx->cur_inode_size = btrfs_inode_size(
sctx->left_path->nodes[0], left_ii); sctx->left_path->nodes[0], left_ii);
sctx->cur_inode_mode = btrfs_inode_mode( sctx->cur_inode_mode = btrfs_inode_mode(
...@@ -6567,8 +6567,8 @@ static int changed_inode(struct send_ctx *sctx, ...@@ -6567,8 +6567,8 @@ static int changed_inode(struct send_ctx *sctx,
ret = send_create_inode_if_needed(sctx); ret = send_create_inode_if_needed(sctx);
} else if (result == BTRFS_COMPARE_TREE_DELETED) { } else if (result == BTRFS_COMPARE_TREE_DELETED) {
sctx->cur_inode_gen = right_gen; sctx->cur_inode_gen = right_gen;
sctx->cur_inode_new = 0; sctx->cur_inode_new = false;
sctx->cur_inode_deleted = 1; sctx->cur_inode_deleted = true;
sctx->cur_inode_size = btrfs_inode_size( sctx->cur_inode_size = btrfs_inode_size(
sctx->right_path->nodes[0], right_ii); sctx->right_path->nodes[0], right_ii);
sctx->cur_inode_mode = btrfs_inode_mode( sctx->cur_inode_mode = btrfs_inode_mode(
...@@ -6586,8 +6586,8 @@ static int changed_inode(struct send_ctx *sctx, ...@@ -6586,8 +6586,8 @@ static int changed_inode(struct send_ctx *sctx,
* First, process the inode as if it was deleted. * First, process the inode as if it was deleted.
*/ */
sctx->cur_inode_gen = right_gen; sctx->cur_inode_gen = right_gen;
sctx->cur_inode_new = 0; sctx->cur_inode_new = false;
sctx->cur_inode_deleted = 1; sctx->cur_inode_deleted = true;
sctx->cur_inode_size = btrfs_inode_size( sctx->cur_inode_size = btrfs_inode_size(
sctx->right_path->nodes[0], right_ii); sctx->right_path->nodes[0], right_ii);
sctx->cur_inode_mode = btrfs_inode_mode( sctx->cur_inode_mode = btrfs_inode_mode(
...@@ -6601,8 +6601,8 @@ static int changed_inode(struct send_ctx *sctx, ...@@ -6601,8 +6601,8 @@ static int changed_inode(struct send_ctx *sctx,
* Now process the inode as if it was new. * Now process the inode as if it was new.
*/ */
sctx->cur_inode_gen = left_gen; sctx->cur_inode_gen = left_gen;
sctx->cur_inode_new = 1; sctx->cur_inode_new = true;
sctx->cur_inode_deleted = 0; sctx->cur_inode_deleted = false;
sctx->cur_inode_size = btrfs_inode_size( sctx->cur_inode_size = btrfs_inode_size(
sctx->left_path->nodes[0], left_ii); sctx->left_path->nodes[0], left_ii);
sctx->cur_inode_mode = btrfs_inode_mode( sctx->cur_inode_mode = btrfs_inode_mode(
...@@ -6634,9 +6634,9 @@ static int changed_inode(struct send_ctx *sctx, ...@@ -6634,9 +6634,9 @@ static int changed_inode(struct send_ctx *sctx,
goto out; goto out;
} else { } else {
sctx->cur_inode_gen = left_gen; sctx->cur_inode_gen = left_gen;
sctx->cur_inode_new = 0; sctx->cur_inode_new = false;
sctx->cur_inode_new_gen = 0; sctx->cur_inode_new_gen = false;
sctx->cur_inode_deleted = 0; sctx->cur_inode_deleted = false;
sctx->cur_inode_size = btrfs_inode_size( sctx->cur_inode_size = btrfs_inode_size(
sctx->left_path->nodes[0], left_ii); sctx->left_path->nodes[0], left_ii);
sctx->cur_inode_mode = btrfs_inode_mode( sctx->cur_inode_mode = btrfs_inode_mode(
......
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