From patchwork Wed Jul 4 13:52:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liubo X-Patchwork-Id: 1156261 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 93FF3DFF0F for ; Wed, 4 Jul 2012 13:55:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753121Ab2GDNzt (ORCPT ); Wed, 4 Jul 2012 09:55:49 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:38125 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750856Ab2GDNzs (ORCPT ); Wed, 4 Jul 2012 09:55:48 -0400 X-IronPort-AV: E=Sophos;i="4.77,524,1336320000"; d="scan'208";a="5329204" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 04 Jul 2012 21:54:56 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id q64DgqxW028818 for ; Wed, 4 Jul 2012 21:42:54 +0800 Received: from localhost.localdomain ([10.167.225.27]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2012070421425659-517860 ; Wed, 4 Jul 2012 21:42:56 +0800 From: Liu Bo To: Subject: [PATCH 4/4] Btrfs: do not count in readonly bytes Date: Wed, 4 Jul 2012 21:52:58 +0800 Message-Id: <1341409978-22423-4-git-send-email-liubo2009@cn.fujitsu.com> X-Mailer: git-send-email 1.6.5.2 In-Reply-To: <1341409978-22423-1-git-send-email-liubo2009@cn.fujitsu.com> References: <1341409978-22423-1-git-send-email-liubo2009@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/07/04 21:42:56, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/07/04 21:42:57, Serialize complete at 2012/07/04 21:42:57 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org If a block group is ro, do not count its entries in when we dump space info. Signed-off-by: Liu Bo --- fs/btrfs/free-space-cache.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index a70c54e..2d5b42e 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -1967,7 +1967,7 @@ void btrfs_dump_free_space(struct btrfs_block_group_cache *block_group, for (n = rb_first(&ctl->free_space_offset); n; n = rb_next(n)) { info = rb_entry(n, struct btrfs_free_space, offset_index); - if (info->bytes >= bytes) + if (info->bytes >= bytes && !block_group->ro) count++; printk(KERN_CRIT "entry offset %llu, bytes %llu, bitmap %s\n", (unsigned long long)info->offset,