From patchwork Thu Mar 24 17:43:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 659421 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2OHiSV8015090 for ; Thu, 24 Mar 2011 17:44:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932804Ab1CXRnz (ORCPT ); Thu, 24 Mar 2011 13:43:55 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:54400 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932655Ab1CXRnw (ORCPT ); Thu, 24 Mar 2011 13:43:52 -0400 Received: by fxm17 with SMTP id 17so265261fxm.19 for ; Thu, 24 Mar 2011 10:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer:in-reply-to:references; bh=+l8x4yuepqGuP77spmWAVLPMQg8zOC/LHS7T72DJsB0=; b=FZIWsoclIwkvDNR2ft3oiYwkunDv1iUQBxsRp//2prVxgdp1uqfcHk9cXkzX4sxLmL VI0sXsiLUMw71WnEakLz/CTQYox0/onCpAgtVbSKRmYHwYO7ph6JP/0TaIj2Lgi12Aqj TcQKzBsVvffkFC27qR8O46lPvm6yn/MOCBWgs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=WvTiXuTgBMx/kGTFrEpf/yCkkPNSBh0aDTsKou5MxR/+Duci9SZmlTBTlogTlHzZXl jPdGh/KXqL7xAxLC5ICNDBnHS76Gu57DXJQL5JI1nVihgmd9pv43Sk6EpNaQU5XJeibk Z4P7wBhdi4D/NBT48UlAHp0GC4F98I9IbsfUw= Received: by 10.223.16.138 with SMTP id o10mr9902150faa.88.1300988594829; Thu, 24 Mar 2011 10:43:14 -0700 (PDT) Received: from localhost.localdomain ([130.75.117.88]) by mx.google.com with ESMTPS id n2sm66979fam.28.2011.03.24.10.43.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Mar 2011 10:43:14 -0700 (PDT) From: Tejun Heo To: chris.mason@oracle.com, peterz@infradead.org, mingo@redhat.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tejun Heo Subject: [PATCH 1/3] btrfs: Cleanup extent_buffer lockdep code Date: Thu, 24 Mar 2011 18:43:06 +0100 Message-Id: <1300988588-13986-2-git-send-email-tj@kernel.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1300988588-13986-1-git-send-email-tj@kernel.org> References: <1300988588-13986-1-git-send-email-tj@kernel.org> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 24 Mar 2011 17:44:28 +0000 (UTC) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 3e1ea3e..e973e0b 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -97,7 +97,9 @@ struct async_submit_bio { struct btrfs_work work; }; -/* These are used to set the lockdep class on the extent buffer locks. +#ifdef CONFIG_LOCKDEP +/* + * These are used to set the lockdep class on the extent buffer locks. * The class is set by the readpage_end_io_hook after the buffer has * passed csum validation but before the pages are unlocked. * @@ -111,7 +113,6 @@ struct async_submit_bio { * the same as our lockdep setup here. If BTRFS_MAX_LEVEL changes, this * code needs update as well. */ -#ifdef CONFIG_DEBUG_LOCK_ALLOC # if BTRFS_MAX_LEVEL != 8 # error # endif @@ -129,7 +130,13 @@ static const char *btrfs_eb_name[BTRFS_MAX_LEVEL + 1] = { /* highest possible level */ "btrfs-extent-08", }; -#endif + +void btrfs_set_buffer_lockdep_class(struct extent_buffer *eb, int level) +{ + lockdep_set_class_and_name(&eb->lock, &btrfs_eb_class[level], + btrfs_eb_name[level]); +} +#endif /* CONFIG_LOCKDEP */ /* * extents on the btree inode are pretty simple, there's one extent @@ -419,15 +426,6 @@ static int check_tree_block_fsid(struct btrfs_root *root, return ret; } -#ifdef CONFIG_DEBUG_LOCK_ALLOC -void btrfs_set_buffer_lockdep_class(struct extent_buffer *eb, int level) -{ - lockdep_set_class_and_name(&eb->lock, - &btrfs_eb_class[level], - btrfs_eb_name[level]); -} -#endif - static int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end, struct extent_state *state) { diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h index 07b20dc..4ab3fa8 100644 --- a/fs/btrfs/disk-io.h +++ b/fs/btrfs/disk-io.h @@ -102,13 +102,12 @@ int btrfs_add_log_tree(struct btrfs_trans_handle *trans, struct btrfs_root *root); int btree_lock_page_hook(struct page *page); - -#ifdef CONFIG_DEBUG_LOCK_ALLOC +#ifdef CONFIG_LOCKDEP void btrfs_set_buffer_lockdep_class(struct extent_buffer *eb, int level); #else static inline void btrfs_set_buffer_lockdep_class(struct extent_buffer *eb, int level) -{ -} -#endif -#endif +{ } +#endif /* CONFIG_LOCKDEP */ + +#endif /* __DISKIO__ */