From patchwork Wed Jul 4 13:52:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liubo X-Patchwork-Id: 1156291 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 BCBEBDFF0F for ; Wed, 4 Jul 2012 13:55:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753251Ab2GDNzz (ORCPT ); Wed, 4 Jul 2012 09:55:55 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:2243 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752039Ab2GDNzv (ORCPT ); Wed, 4 Jul 2012 09:55:51 -0400 X-IronPort-AV: E=Sophos;i="4.77,524,1336320000"; d="scan'208";a="5329206" 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 q64DgqJo028817 for ; Wed, 4 Jul 2012 21:42:53 +0800 Received: from localhost.localdomain ([10.167.225.27]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2012070421425657-517859 ; Wed, 4 Jul 2012 21:42:56 +0800 From: Liu Bo To: Subject: [PATCH 3/4] Btrfs: add ro notification to dump_space_info Date: Wed, 4 Jul 2012 21:52:57 +0800 Message-Id: <1341409978-22423-3-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 Block group has ro attributes, make dump_space_info show it. Signed-off-by: Liu Bo --- fs/btrfs/extent-tree.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index bbe79ab..f29859b 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -5847,12 +5847,13 @@ again: list_for_each_entry(cache, &info->block_groups[index], list) { spin_lock(&cache->lock); printk(KERN_INFO "block group %llu has %llu bytes, %llu used " - "%llu pinned %llu reserved\n", + "%llu pinned %llu reserved %s\n", (unsigned long long)cache->key.objectid, (unsigned long long)cache->key.offset, (unsigned long long)btrfs_block_group_used(&cache->item), (unsigned long long)cache->pinned, - (unsigned long long)cache->reserved); + (unsigned long long)cache->reserved, + cache->ro ? "[readonly]" : ""); btrfs_dump_free_space(cache, bytes); spin_unlock(&cache->lock); }