From patchwork Wed Nov 25 08:55:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 62728 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 nAP8uR4h020058 for ; Wed, 25 Nov 2009 08:56:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934559AbZKYIz6 (ORCPT ); Wed, 25 Nov 2009 03:55:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934496AbZKYIz5 (ORCPT ); Wed, 25 Nov 2009 03:55:57 -0500 Received: from rcsinet12.oracle.com ([148.87.113.124]:29631 "EHLO rgminet12.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934489AbZKYIzr (ORCPT ); Wed, 25 Nov 2009 03:55:47 -0500 Received: from rgminet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id nAP8tk0W006288 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 Nov 2009 08:55:47 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by rgminet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id nAP8tnIt032767 for ; Wed, 25 Nov 2009 08:55:50 GMT Received: from abhmt006.oracle.com by acsmt358.oracle.com with ESMTP id 595402651259139325; Wed, 25 Nov 2009 02:55:25 -0600 Received: from [10.182.120.231] (/10.182.120.231) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 25 Nov 2009 00:55:25 -0800 Message-ID: <4B0CF0F7.7070206@oracle.com> Date: Wed, 25 Nov 2009 16:55:19 +0800 From: "Yan, Zheng" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Thunderbird/3.0b4 MIME-Version: 1.0 To: linux-btrfs@vger.kernel.org, chris Mason Subject: [PATCH] Btrfs: don't add extent 0 to the free space cache X-Source-IP: acsmt358.oracle.com [141.146.40.158] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090206.4B0CF116.004B:SCFMA4539814,ss=1,fgs=0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org diff -urp 1/fs/btrfs/extent-tree.c 2/fs/btrfs/extent-tree.c --- 1/fs/btrfs/extent-tree.c 2009-11-23 13:59:11.415598041 +0800 +++ 2/fs/btrfs/extent-tree.c 2009-11-25 16:20:52.865565692 +0800 @@ -195,6 +195,14 @@ static int exclude_super_stripes(struct int stripe_len; int i, nr, ret; + if (cache->key.objectid < BTRFS_SUPER_INFO_OFFSET) { + stripe_len = BTRFS_SUPER_INFO_OFFSET - cache->key.objectid; + cache->bytes_super += stripe_len; + ret = add_excluded_extent(root, cache->key.objectid, + stripe_len); + BUG_ON(ret); + } + for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) { bytenr = btrfs_sb_offset(i); ret = btrfs_rmap_block(&root->fs_info->mapping_tree,