[RFC PATCH 09/14] btrfs-progs: restore: delete unreachable code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 cmds/restore.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

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);
-- 
1.8.3.1




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux