Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fVKc3-000174-Oh for mharc-grub-devel@gnu.org; Tue, 19 Jun 2018 13:40:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVKc1-00014J-K8 for grub-devel@gnu.org; Tue, 19 Jun 2018 13:40:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVKc0-0007b1-Mi for grub-devel@gnu.org; Tue, 19 Jun 2018 13:40:13 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:39906) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVKc0-0007af-GY for grub-devel@gnu.org; Tue, 19 Jun 2018 13:40:12 -0400 Received: by mail-wm0-x241.google.com with SMTP id p11-v6so1953201wmc.4 for ; Tue, 19 Jun 2018 10:40:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rg8WbXOhzIfSWjqMccYPLTxMaob5oXicW9enkt21REo=; b=LKetB6mLJaBYd4sTQ721OlS0n40+OcdeiM/bTThp4S7d9kMU1CixaopavBTgfRNz+4 Mw4iEJgfla/1saR1Vt8cRkT7EkNh8Iq1HY4duXhdUNH7eXOT5bKdCgDb/XTRVHgo0BX6 jb93wj7aTRgsPpNDRX+yXX7RENo5Cpgb8x0hzzT6MwgtTGB/1EynMslxTopd4uTzKzf/ +EmNiE5XzfroepJy7oxa1NjCdtwF4FVUzNTHK8diM2aewAi6lcWerDwCKqwtnR2oIZG2 1FjGsB2i8khG28Tk6UsY80/PSIwoYedkviAfQw/0F96XgCE4KNV8iSnsN5gdJzlFEM08 OOTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rg8WbXOhzIfSWjqMccYPLTxMaob5oXicW9enkt21REo=; b=TWed7qF7dRueF0Ce4h3j8c3A7hdcCvPvpQ5cn04a6K0+3wRravZv9wG7/OYI5wly5P GG4Ph2EtoV6Ahl5d4JPt03X1cpJ8sYeBj40n0JBIG6rqq3bYPD0RllpFip9b6a7DtCrd B7Vs/PygCsTY7uUtJZ2CuqX5BlWKGevq/uKkXAoimdC/6Na6XZgjXoV/RLv2GqmO/huF +3Byx7P4d0a5zOfe0b3AN0VxJHZ7kxLU6rfWT3zsV3h6jyyXQK8qnQcGM82uV6A/RaZR 5cxutdV8KUWRp3uGivxHmHtLAh1IzC9+O/vHzxSdxPrCwPlKvI5/IE/G60h437rK4H9d mWFg== X-Gm-Message-State: APt69E3Bb/ovncJXItFytyIA6t5CrrxCZYwaUaQFse6kpR6k3nN6vlxg ctd/oLCWUkpaCgn74Ep+Sjur4g== X-Google-Smtp-Source: ADUXVKJiH7+xJo7ZjbhRwWqpdD1t545qWUYXmp5kpUGxVoy0g4SvzlM0K9E9w57RjO/iBcLmoAryKw== X-Received: by 2002:a1c:7d94:: with SMTP id y142-v6mr13019854wmc.107.1529430011321; Tue, 19 Jun 2018 10:40:11 -0700 (PDT) Received: from venice.bhome (84-223-210-152.adsl-wholesale.clienti.tiscali.it. [84.223.210.152]) by smtp.gmail.com with ESMTPSA id i4-v6sm291776wrq.28.2018.06.19.10.40.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 10:40:10 -0700 (PDT) From: Goffredo Baroncelli X-Google-Original-From: Goffredo Baroncelli To: grub-devel@gnu.org Cc: Goffredo Baroncelli Subject: [PATCH 5/9] btrfs: Move logging code in grub_btrfs_read_logical() Date: Tue, 19 Jun 2018 19:39:52 +0200 Message-Id: <20180619173956.7356-6-kreijack@inwind.it> X-Mailer: git-send-email 2.18.0.rc2 In-Reply-To: <20180619173956.7356-1-kreijack@inwind.it> References: <20180619173956.7356-1-kreijack@inwind.it> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2018 17:40:14 -0000 A portion of the logging code is moved outside of internal for(;;). The part that is left inside is the one which depends on the internal for(;;) index. This is a preparatory patch. The next one will refactor the code inside the for(;;) into an another function. Signed-off-by: Goffredo Baroncelli --- grub-core/fs/btrfs.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index 70bcb0fdc..15ed59151 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -867,6 +867,18 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr, for (j = 0; j < 2; j++) { + grub_dprintf ("btrfs", "chunk 0x%" PRIxGRUB_UINT64_T + "+0x%" PRIxGRUB_UINT64_T + " (%d stripes (%d substripes) of %" + PRIxGRUB_UINT64_T ")\n", + grub_le_to_cpu64 (key->offset), + grub_le_to_cpu64 (chunk->size), + grub_le_to_cpu16 (chunk->nstripes), + grub_le_to_cpu16 (chunk->nsubstripes), + grub_le_to_cpu64 (chunk->stripe_length)); + grub_dprintf ("btrfs", "reading laddr 0x%" PRIxGRUB_UINT64_T "\n", + addr); + for (i = 0; i < redundancy; i++) { struct grub_btrfs_chunk_stripe *stripe; @@ -879,20 +891,11 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr, paddr = grub_le_to_cpu64 (stripe->offset) + stripe_offset; - grub_dprintf ("btrfs", "chunk 0x%" PRIxGRUB_UINT64_T - "+0x%" PRIxGRUB_UINT64_T - " (%d stripes (%d substripes) of %" - PRIxGRUB_UINT64_T ") stripe %" PRIxGRUB_UINT64_T + grub_dprintf ("btrfs", "stripe %" PRIxGRUB_UINT64_T " maps to 0x%" PRIxGRUB_UINT64_T "\n", - grub_le_to_cpu64 (key->offset), - grub_le_to_cpu64 (chunk->size), - grub_le_to_cpu16 (chunk->nstripes), - grub_le_to_cpu16 (chunk->nsubstripes), - grub_le_to_cpu64 (chunk->stripe_length), stripen, stripe->offset); grub_dprintf ("btrfs", "reading paddr 0x%" PRIxGRUB_UINT64_T - " for laddr 0x%" PRIxGRUB_UINT64_T "\n", paddr, - addr); + "\n", paddr); dev = find_device (data, stripe->device_id); if (!dev) -- 2.18.0.rc2