[RFC,09/14] btrfs-progs: restore: delete unreachable code
diff mbox series

Message ID 1571652082-25982-10-git-send-email-anand.jain@oracle.com
State New
Headers show
Series
  • btrfs-progs: global-verbose option
Related show

Commit Message

Anand Jain Oct. 21, 2019, 10:01 a.m. UTC
Maximum value of %verbose is 1 when %verbose is enabled using
'btrfs restore -v <dev> <dir>', and the code under the condition
%verbose > 1 is never reached. So delete them.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 cmds/restore.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

Patch
diff mbox series

diff --git a/cmds/restore.c b/cmds/restore.c
index c104b01aef69..79caf6734e76 100644
--- a/cmds/restore.c
+++ b/cmds/restore.c
@@ -987,9 +987,6 @@  static int search_dir(struct btrfs_root *root, struct btrfs_key *key,
 
 	leaf = path.nodes[0];
 	while (!leaf) {
-		if (verbose > 1)
-			printf("No leaf after search, looking for the next "
-			       "leaf\n");
 		ret = next_leaf(root, &path);
 		if (ret < 0) {
 			fprintf(stderr, "Error getting next leaf %d\n",
@@ -1035,18 +1032,12 @@  static int search_dir(struct btrfs_root *root, struct btrfs_key *key,
 			continue;
 		}
 		btrfs_item_key_to_cpu(leaf, &found_key, path.slots[0]);
-		if (found_key.objectid != key->objectid) {
-			if (verbose > 1)
-				printf("Found objectid=%Lu, key=%Lu\n",
-				       found_key.objectid, key->objectid);
+		if (found_key.objectid != key->objectid)
 			break;
-		}
-		if (found_key.type != key->type) {
-			if (verbose > 1)
-				printf("Found type=%u, want=%u\n",
-				       found_key.type, key->type);
+
+		if (found_key.type != key->type)
 			break;
-		}
+
 		dir_item = btrfs_item_ptr(leaf, path.slots[0],
 					  struct btrfs_dir_item);
 		name_ptr = (unsigned long)(dir_item + 1);