From patchwork Wed Sep 19 18:40:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goffredo Baroncelli X-Patchwork-Id: 10606193 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C816A1390 for ; Wed, 19 Sep 2018 18:41:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB7C92C841 for ; Wed, 19 Sep 2018 18:41:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AFEC02C84D; Wed, 19 Sep 2018 18:41:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A49D2C841 for ; Wed, 19 Sep 2018 18:41:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732370AbeITAUY (ORCPT ); Wed, 19 Sep 2018 20:20:24 -0400 Received: from smtp-33-i6.italiaonline.it ([213.209.14.33]:53100 "EHLO libero.it" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732270AbeITAUY (ORCPT ); Wed, 19 Sep 2018 20:20:24 -0400 Received: from venice.bhome ([94.38.18.13]) by smtp-33.iol.local with ESMTPA id 2hPRgg79sQGOz2hPUgVZpc; Wed, 19 Sep 2018 20:41:12 +0200 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1537382472; bh=RlOCe2YXy9vYtmsgCwEQ37o/Ou37adAeRmroKjY8Vu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=g1mR5nU5D69Vr65SjY0C8SdgbImxOyWj4M/TDKEO8sDabO5UXnHLbqY4Q77meGUxy GFR16Gvk1cKQoaYqwchWmNYe4USS5zJw5QZt3HsjZQ2t7jdur7rO1hCtDSLGqOx4pv yHDDukCtd0qeULLnV504eGLMZ7HZZq3aH7ysxq0nhHVTydpGpJk+ggioLWyGyBBVLF XcYzCnmbeoRUpGK2AJ/5QkaZUy/RdxFDD8M+UWd5fPfHalUsz30W0XbjOcvxfdgRm8 Cb1sdfNxxhanBjV6u1EWQESk1N/JsqLWSxKaPKrOGAwH2HENEjKys0sjVPRfkZPP49 x9OxFjWmMjhRA== X-CNFS-Analysis: v=2.3 cv=OvCeNB3t c=1 sm=1 tr=0 a=y+pHRDKYf/eurU+tzaSv/w==:117 a=y+pHRDKYf/eurU+tzaSv/w==:17 a=yPCof4ZbAAAA:8 a=tbGcK1RVRLHxssNcnxoA:9 a=R0ZrlE3BOGKx5Mtq:21 a=LACR2KO_iN7HUbMU:21 From: Goffredo Baroncelli To: grub-devel@gnu.org Cc: Daniel Kiper , linux-btrfs@vger.kernel.org, Goffredo Baroncelli Subject: [PATCH 5/9] btrfs: Move logging code in grub_btrfs_read_logical() Date: Wed, 19 Sep 2018 20:40:36 +0200 Message-Id: <20180919184040.22540-6-kreijack@libero.it> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180919184040.22540-1-kreijack@libero.it> References: <20180919184040.22540-1-kreijack@libero.it> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfFZcIo3ET48ebVvPHE+jIj4TnauOPMDwNPmhC0hgzHV0L8oQfX2vSujgxUKOhSgDKu977wcy8pWjjEJqI+HHVQNnJP5/JfV9rM9Spz1ha7dUX3420m9N QARbjG/JM6Om9TWPegXvwKQx6xGcWxVvnzUAM4baPumgbnSJZpFaCNIYl6GEYiIOkQPnF+ZZHvlckHqITNw6J1XFRRFkYT/c2swK0hpXxM7RXUh1MkVN6oPG qh+NUC3Hw31yFxhxa5be9wyeW4kpskpHU4oAjo+7X2Q= Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Goffredo Baroncelli 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 Reviewed-by: Daniel Kiper --- 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 6e42c33f6..ee134c167 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -863,6 +863,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; @@ -875,20 +887,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)