Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fPY8f-0004DI-UT for mharc-grub-devel@gnu.org; Sun, 03 Jun 2018 14:54:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPY8d-0004BI-OJ for grub-devel@gnu.org; Sun, 03 Jun 2018 14:54:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPY8c-00004z-T1 for grub-devel@gnu.org; Sun, 03 Jun 2018 14:53:59 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:40030) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPY8c-0008Vl-LN for grub-devel@gnu.org; Sun, 03 Jun 2018 14:53:58 -0400 Received: by mail-wm0-x242.google.com with SMTP id x2-v6so10650286wmh.5 for ; Sun, 03 Jun 2018 11:53:58 -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=qLJtgb92f+uzupqilK/lzIVnQWR0npyIZ4b1Y7/wt08=; b=RAUZZXHjDC1QQR6710NM2JOfe2d33wsrIab42yWHgjWJHZvl6F3gWFIOgdC8NryWl+ mTtYJzd6c6RosUhwCZ0kp3c9OWBJImzumjOZ1+FrWljaxQRtjlxV13NHXcggPOBHD/Kg 23/S8gmj2BCWa4qJFieR7b1RXGdrs4WOVVU0fV3FFuZjeA/JeuQ3TleNjdw1wpxDNdRT atQGkgaDloTZNUPfYGQrBf9eH48lIIY6vEqvoeTP8Mt4NZ4+zL7p0hCbRaG+pnbkO5/l SFOph12h0wZAN9JypHdMjwM0hKaiizTrYYmBLqx4d+gtS4QgYMRzh/AQaG0iPZ64bMH1 VNew== 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=qLJtgb92f+uzupqilK/lzIVnQWR0npyIZ4b1Y7/wt08=; b=Pp3mw0u9eJVXTEKSY3ioQJWHY1JarmdEdQatxjbxTXhWaAnS5mhHOQfpckbOnEeLGd DYY8PXVUaPdp3YmgVmyaD94Vc1SA2Mm2n0bBNt29pjC6WIhO9hQN1izkmYcINlsAVi8K +5wObRDRSaxMrpD30oQ2ITZbaBCNozlpCygC6N/Jip/tUBN8QXs41ZPA3hrdLAFaYnam IQh9v58WpicJXjq8HgvZ7koh78vl1C/PMTlU3vsurgtKNAWaE6Nd0+7OVV2fLntpMxRe TwfhSBqULckbG/gPWu9TRa+gQuprm8WRXD0P5JzYt0zmEHHKLkF6wIz1AkNsEca32xsf Zjsg== X-Gm-Message-State: APt69E3KBR24MNeRfNw3oubiQWXbWfTxqlmqg6AesKS4X86cYFochL/G yevdGcDT92/JqON0rYgq9o161g== X-Google-Smtp-Source: ADUXVKJ64R3bSkO9odP0vNamCx+PX03wsr6Nfns7uSLLpAkY+EQ3FLazTWf7cHC21RENzUT7RwA9og== X-Received: by 2002:a1c:92ce:: with SMTP id u197-v6mr6146058wmd.120.1528052037274; Sun, 03 Jun 2018 11:53:57 -0700 (PDT) Received: from venice.bhome (84-223-211-96.adsl-wholesale.clienti.tiscali.it. [84.223.211.96]) by smtp.gmail.com with ESMTPSA id b124-v6sm1279940wmf.11.2018.06.03.11.53.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Jun 2018 11:53:56 -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: Sun, 3 Jun 2018 20:53:44 +0200 Message-Id: <20180603185348.1780-6-kreijack@inwind.it> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180603185348.1780-1-kreijack@inwind.it> References: <20180603185348.1780-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::242 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: Sun, 03 Jun 2018 18:54:00 -0000 A portion of the logging code is moved outside of internal for(;;). The part that is left inside is the one which depends by the internal for(;;) index. This is a preparatory patch: in the next one it will be possible to refactor the code inside the for(;;) in 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 b64b692f8..e2baed665 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.17.1