Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fJ1TX-0000A4-QZ for mharc-grub-devel@gnu.org; Wed, 16 May 2018 14:48:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ1TU-00007p-QS for grub-devel@gnu.org; Wed, 16 May 2018 14:48:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJ1TU-0006vA-01 for grub-devel@gnu.org; Wed, 16 May 2018 14:48:32 -0400 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:36840) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJ1TT-0006uf-PQ for grub-devel@gnu.org; Wed, 16 May 2018 14:48:31 -0400 Received: by mail-wm0-x236.google.com with SMTP id n10-v6so4222424wmc.1 for ; Wed, 16 May 2018 11:48:31 -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=BYyOyMjBfvLvQlmxBh5nBf/xfgJ5+96QKI9ODL8lbJw=; b=EfXj/WJIh/AWC9CtnilFPicEaN2ZO2R52Bfhh5VJrScQ6NdHL2g0jwXyWjBUd9xLEQ xqpFY8NjCiVXOu+zSy12hXq0FQ4RbbblJYjcs/FP4bgt+7TAgm7r0oKrxThYs/uobFZE zFmcHiCM2jv314uNGH8+S34VgJ0NKxarjMpuyMwhDPpjzQNzeGbB6p68Uw5nlssC33wl yi4c4amvqir7tJ8rd/2nA9h81X9OvPCY5s93ORpKO24OQJJhDwVpPQXiAczS20pAYYzi N9TjFo3KnMdVn20VvX8isoE95jtrLjcRi4yjjZsTFBgN3TbH4GOIOmOdDJYSvl373C74 +4eQ== 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=BYyOyMjBfvLvQlmxBh5nBf/xfgJ5+96QKI9ODL8lbJw=; b=FLS5UKPdhAaNhV8Kf1BS6QNRIk6hA6W8dDycEyoQO9wrq5D5bh9AONI7oBpzt7j3bm LaEqQQEoLEmaRjJj6sNDW5FbIZ/f8jd/zkANyR6HibsEuEuECkf+LcZhPik9yr/24XXX HNEDv9Y9LvlxGseh9r2g5iMJCzvldlxDRRiWwNC4JH5AzcqXZBzZDExXxddxEtoBREnj SY305+KarMtoOPATDtUCfHVJWRzPlP+0RgwKTUvDGCNdx5GgC4lV/I2WzHJ/6Db74ncA Fy/WpEuOKic8kxkpeZ+5v0btC+fGHhoZPNzwEyASTOVIaeXmeb+xGIXhIBTQhvJPML2x cM+A== X-Gm-Message-State: ALKqPwf8bvChp9vjNJeaKzfd3ThjeNL5ibHjGO6KnCQmw4J44BL3G8Wh hI7VALi3E8+6qnbhF48JlfQRAA== X-Google-Smtp-Source: AB8JxZql97s4udDt4pJVwXc239SzmpOR779bhhLIyWMle3vEL/M5WNMauMGyTQz3HF1fLG7R9RyPKQ== X-Received: by 2002:a1c:e14:: with SMTP id 20-v6mr1570475wmo.85.1526496510408; Wed, 16 May 2018 11:48:30 -0700 (PDT) Received: from venice.bhome (94-38-2-55.adsl-ull.clienti.tiscali.it. [94.38.2.55]) by smtp.gmail.com with ESMTPSA id d17-v6sm3797129wrc.0.2018.05.16.11.48.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 May 2018 11:48:29 -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: Wed, 16 May 2018 20:48:15 +0200 Message-Id: <20180516184819.23736-6-kreijack@inwind.it> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516184819.23736-1-kreijack@inwind.it> References: <20180516184819.23736-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::236 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: Wed, 16 May 2018 18:48:33 -0000 A portion of the logging code is moved outside a for(;;). The part that is left inside is the one which depends by the 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. --- 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 4920dd3b1..51f300829 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -865,6 +865,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; @@ -877,20 +889,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.0