From patchwork Fri Jul 6 09:31:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liubo X-Patchwork-Id: 1163821 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E96D340135 for ; Fri, 6 Jul 2012 09:21:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755023Ab2GFJVZ (ORCPT ); Fri, 6 Jul 2012 05:21:25 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:2103 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751381Ab2GFJVX (ORCPT ); Fri, 6 Jul 2012 05:21:23 -0400 X-IronPort-AV: E=Sophos;i="4.77,537,1336320000"; d="scan'208";a="5343998" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 06 Jul 2012 17:20:29 +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 q669LDsF009989 for ; Fri, 6 Jul 2012 17:21:18 +0800 Received: from localhost.localdomain ([10.167.225.27]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2012070617211844-559296 ; Fri, 6 Jul 2012 17:21:18 +0800 From: Liu Bo To: Subject: [PATCH 3/4 v2] Btrfs: add ro notification to dump_space_info Date: Fri, 6 Jul 2012 17:31:35 +0800 Message-Id: <1341567096-30304-3-git-send-email-liubo2009@cn.fujitsu.com> X-Mailer: git-send-email 1.6.5.2 In-Reply-To: <1341567096-30304-1-git-send-email-liubo2009@cn.fujitsu.com> References: <1341567096-30304-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/06 17:21:18, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/07/06 17:21:19, Serialize complete at 2012/07/06 17:21:19 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 --- v1->v2: make printk more friendly to grep. fs/btrfs/extent-tree.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index ae01bc8..f200e0c 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -5854,13 +5854,13 @@ static void dump_space_info(struct btrfs_space_info *info, u64 bytes, 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", + printk(KERN_INFO "block group %llu has %llu bytes, %llu used %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); }