From patchwork Sun Sep 1 20:08:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goldwyn Rodrigues X-Patchwork-Id: 11125645 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 492321510 for ; Sun, 1 Sep 2019 20:09:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3210122CF7 for ; Sun, 1 Sep 2019 20:09:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728879AbfIAUIu (ORCPT ); Sun, 1 Sep 2019 16:08:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:50372 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728610AbfIAUIt (ORCPT ); Sun, 1 Sep 2019 16:08:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B2210B07B; Sun, 1 Sep 2019 20:08:48 +0000 (UTC) From: Goldwyn Rodrigues To: linux-fsdevel@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, darrick.wong@oracle.com, hch@lst.de, david@fromorbit.com, riteshh@linux.ibm.com, Goldwyn Rodrigues Subject: [PATCH 01/15] iomap: Introduce CONFIG_FS_IOMAP_DEBUG Date: Sun, 1 Sep 2019 15:08:22 -0500 Message-Id: <20190901200836.14959-2-rgoldwyn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190901200836.14959-1-rgoldwyn@suse.de> References: <20190901200836.14959-1-rgoldwyn@suse.de> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Goldwyn Rodrigues To improve debugging abilities, especially invalid option asserts. Signed-off-by: Goldwyn Rodrigues Signed-off-by: Goldwyn Rodrigues Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/Kconfig | 3 +++ include/linux/iomap.h | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/fs/Kconfig b/fs/Kconfig index bfb1c6095c7a..4bed5df9b55f 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -19,6 +19,9 @@ if BLOCK config FS_IOMAP bool +config FS_IOMAP_DEBUG + bool "Debugging for the iomap code" + depends on FS_IOMAP source "fs/ext2/Kconfig" source "fs/ext4/Kconfig" diff --git a/include/linux/iomap.h b/include/linux/iomap.h index bc499ceae392..209b6c93674e 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -18,6 +18,17 @@ struct page; struct vm_area_struct; struct vm_fault; +#ifdef CONFIG_FS_IOMAP_DEBUG +#define iomap_assert(expr) \ + if(!(expr)) { \ + printk( "Assertion failed! %s,%s,%s,line=%d\n",\ +#expr,__FILE__,__func__,__LINE__); \ + BUG(); \ + } +#else +#define iomap_assert(expr) +#endif + /* * Types of block ranges for iomap mappings: */