From patchwork Wed Nov 4 19:03:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Mahoney X-Patchwork-Id: 57754 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA4JCjOn006315 for ; Wed, 4 Nov 2009 19:12:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755738AbZKDTM0 (ORCPT ); Wed, 4 Nov 2009 14:12:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756058AbZKDTM0 (ORCPT ); Wed, 4 Nov 2009 14:12:26 -0500 Received: from cpe-66-66-77-145.rochester.res.rr.com ([66.66.77.145]:38320 "EHLO galileo.lan.jeffreymahoney.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755738AbZKDTMW (ORCPT ); Wed, 4 Nov 2009 14:12:22 -0500 Received: by galileo.lan.jeffreymahoney.com (Postfix, from userid 1000) id B56703D01; Wed, 4 Nov 2009 14:04:33 -0500 (EST) Message-Id: <20091104190433.477436095@suse.com> User-Agent: quilt/0.48-4.4 Date: Wed, 04 Nov 2009 14:03:51 -0500 From: Jeff Mahoney To: linux-btrfs@vger.kernel.org Subject: [patch 05/10] btrfs: Add BTRFS_UERROR for unhandled errors References: <20091104190346.971762946@suse.com> Content-Disposition: inline; filename=btrfs-add-BTRFS_UERROR Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -1951,6 +1951,13 @@ static inline struct dentry *fdentry(str return file->f_path.dentry; } +#define BTRFS_UERROR(condition) \ + do { \ + if (condition) \ + btrfs_unhandled_error(__FILE__, __LINE__, \ + #condition); \ + } while(0); + /* extent-tree.c */ void btrfs_put_block_group(struct btrfs_block_group_cache *cache); int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, @@ -2373,6 +2380,7 @@ ssize_t btrfs_listxattr(struct dentry *d u64 btrfs_parse_size(char *str); int btrfs_parse_options(struct btrfs_root *root, char *options); int btrfs_sync_fs(struct super_block *sb, int wait); +void btrfs_unhandled_error(const char *file, int line, const char *condition); /* acl.c */ #ifdef CONFIG_BTRFS_FS_POSIX_ACL --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -51,6 +51,14 @@ #include "export.h" #include "compression.h" +void btrfs_unhandled_error(const char *file, int line, const char *msg) +{ + printk(KERN_CRIT "btrfs: Unhandled error at %s:%d: %s\n", + file, line, msg); + + BUG(); +} + static struct super_operations btrfs_super_ops; static void btrfs_put_super(struct super_block *sb)