Skip to contentSkip to conversation

Btrfs: remove unnecessary inode generation lookup in send

PATCH In review Filipe David Borba Manana 2 participants 2 messages Mar 18, 2014 – Mar 20, 2014 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: remove unnecessary inode generation lookup in send

No need to search in the send tree for the generation number of the inode, we already have it in the recorded_ref structure passed to us.

---
 fs/btrfs/send.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
fs/btrfs/send.c +2 -7
index 5d757ee..db4b10c 100644
@@ -3179,7 +3179,7 @@ static int wait_for_parent_move(struct send_ctx *sctx,
 	int ret;
 	u64 ino = parent_ref->dir;
 	u64 parent_ino_before, parent_ino_after;
-	u64 new_gen, old_gen;
+	u64 old_gen;
 	struct fs_path *path_before = NULL;
 	struct fs_path *path_after = NULL;
 	int len1, len2;
@@ -3198,12 +3198,7 @@ static int wait_for_parent_move(struct send_ctx *sctx,
 	else if (ret < 0)
 		return ret;
 
-	ret = get_inode_info(sctx->send_root, ino, NULL, &new_gen,
-			     NULL, NULL, NULL, NULL);
-	if (ret < 0)
-		return ret;
-
-	if (new_gen != old_gen)
+	if (parent_ref->dir_gen != old_gen)
 		return 0;
 
 	path_before = fs_path_alloc();
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Filipe David Borba Manana

No need to search in the send tree for the generation number of the inode, we already have it in the recorded_ref structure passed to us.

-liubo

Quoted 39 lines
---
 fs/btrfs/send.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
fs/btrfs/send.c +2 -7
index 5d757ee..db4b10c 100644
@@ -3179,7 +3179,7 @@ static int wait_for_parent_move(struct send_ctx *sctx,
 	int ret;
 	u64 ino = parent_ref->dir;
 	u64 parent_ino_before, parent_ino_after;
-	u64 new_gen, old_gen;
+	u64 old_gen;
 	struct fs_path *path_before = NULL;
 	struct fs_path *path_after = NULL;
 	int len1, len2;
@@ -3198,12 +3198,7 @@ static int wait_for_parent_move(struct send_ctx *sctx,
 	else if (ret < 0)
 		return ret;
 
-	ret = get_inode_info(sctx->send_root, ino, NULL, &new_gen,
-			     NULL, NULL, NULL, NULL);
-	if (ret < 0)
-		return ret;
-
-	if (new_gen != old_gen)
+	if (parent_ref->dir_gen != old_gen)
 		return 0;
 
 	path_before = fs_path_alloc();
Signature · 6 lines
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html