From patchwork Thu Dec 9 18:27:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 395562 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 oB9IbKQh003448 for ; Thu, 9 Dec 2010 18:37:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750985Ab0LIShR (ORCPT ); Thu, 9 Dec 2010 13:37:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42410 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750928Ab0LIShQ (ORCPT ); Thu, 9 Dec 2010 13:37:16 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB9IbF8R018014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 Dec 2010 13:37:15 -0500 Received: from localhost.localdomain (test1244.test.redhat.com [10.10.10.244]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oB9IbFEn028819 for ; Thu, 9 Dec 2010 13:37:15 -0500 From: Josef Bacik To: linux-btrfs@vger.kernel.org Subject: [PATCH] Btrfs-progs: update super fields for space cache Date: Thu, 9 Dec 2010 13:27:03 -0500 Message-Id: <1291919223-17489-1-git-send-email-josef@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 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.3 (demeter1.kernel.org [140.211.167.41]); Thu, 09 Dec 2010 18:37:20 +0000 (UTC) diff --git a/ctree.h b/ctree.h index b79e238..962c510 100644 --- a/ctree.h +++ b/ctree.h @@ -340,8 +340,10 @@ struct btrfs_super_block { char label[BTRFS_LABEL_SIZE]; + __le64 cache_generation; + /* future expansion */ - __le64 reserved[32]; + __le64 reserved[31]; u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE]; } __attribute__ ((__packed__)); @@ -1564,6 +1566,8 @@ BTRFS_SETGET_STACK_FUNCS(super_incompat_flags, struct btrfs_super_block, incompat_flags, 64); BTRFS_SETGET_STACK_FUNCS(super_csum_type, struct btrfs_super_block, csum_type, 16); +BTRFS_SETGET_STACK_FUNCS(super_cache_generation, struct btrfs_super_block, + cache_generation, 64); static inline int btrfs_super_csum_size(struct btrfs_super_block *s) { diff --git a/utils.c b/utils.c index 2f4c6e1..b890728 100644 --- a/utils.c +++ b/utils.c @@ -103,6 +103,7 @@ int make_btrfs(int fd, const char *device, const char *label, btrfs_set_super_stripesize(&super, stripesize); btrfs_set_super_csum_type(&super, BTRFS_CSUM_TYPE_CRC32); btrfs_set_super_chunk_root_generation(&super, 1); + btrfs_set_super_cache_generation(&super, -1); if (label) strcpy(super.label, label);