summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/btrfs-tools/btrfs-tools/upstream-tmp/0006-Btrfs-progs-update-super-fields-for-space-cache.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/btrfs-tools/btrfs-tools/upstream-tmp/0006-Btrfs-progs-update-super-fields-for-space-cache.patch')
-rw-r--r--meta/recipes-devtools/btrfs-tools/btrfs-tools/upstream-tmp/0006-Btrfs-progs-update-super-fields-for-space-cache.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools/upstream-tmp/0006-Btrfs-progs-update-super-fields-for-space-cache.patch b/meta/recipes-devtools/btrfs-tools/btrfs-tools/upstream-tmp/0006-Btrfs-progs-update-super-fields-for-space-cache.patch
new file mode 100644
index 0000000000..d8b8b108e8
--- /dev/null
+++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools/upstream-tmp/0006-Btrfs-progs-update-super-fields-for-space-cache.patch
@@ -0,0 +1,57 @@
1Upstream-Status: Inappropriate [Backport]
2From c2cefc42ebf8e32e36b1866048a02a579f2cef9a Mon Sep 17 00:00:00 2001
3From: Josef Bacik <josef@redhat.com>
4Date: Thu, 9 Dec 2010 18:27:03 +0000
5Subject: [PATCH 06/15] Btrfs-progs: update super fields for space cache
6
7This patch updates the super field to add the cache_generation member. It also
8makes us set it to -1 on mkfs so any new filesystem will get the space cache
9stuff turned on. Thanks,
10
11Signed-off-by: Josef Bacik <josef@redhat.com>
12Signed-off-by: Chris Mason <chris.mason@oracle.com>
13---
14 ctree.h | 6 +++++-
15 utils.c | 1 +
16 2 files changed, 6 insertions(+), 1 deletions(-)
17
18diff --git a/ctree.h b/ctree.h
19index b79e238..962c510 100644
20--- a/ctree.h
21+++ b/ctree.h
22@@ -340,8 +340,10 @@ struct btrfs_super_block {
23
24 char label[BTRFS_LABEL_SIZE];
25
26+ __le64 cache_generation;
27+
28 /* future expansion */
29- __le64 reserved[32];
30+ __le64 reserved[31];
31 u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
32 } __attribute__ ((__packed__));
33
34@@ -1564,6 +1566,8 @@ BTRFS_SETGET_STACK_FUNCS(super_incompat_flags, struct btrfs_super_block,
35 incompat_flags, 64);
36 BTRFS_SETGET_STACK_FUNCS(super_csum_type, struct btrfs_super_block,
37 csum_type, 16);
38+BTRFS_SETGET_STACK_FUNCS(super_cache_generation, struct btrfs_super_block,
39+ cache_generation, 64);
40
41 static inline int btrfs_super_csum_size(struct btrfs_super_block *s)
42 {
43diff --git a/utils.c b/utils.c
44index 2a15d86..35e17b8 100644
45--- a/utils.c
46+++ b/utils.c
47@@ -107,6 +107,7 @@ int make_btrfs(int fd, const char *device, const char *label,
48 btrfs_set_super_stripesize(&super, stripesize);
49 btrfs_set_super_csum_type(&super, BTRFS_CSUM_TYPE_CRC32);
50 btrfs_set_super_chunk_root_generation(&super, 1);
51+ btrfs_set_super_cache_generation(&super, -1);
52 if (label)
53 strncpy(super.label, label, BTRFS_LABEL_SIZE - 1);
54
55--
561.7.2.3
57