Skip to content

Commit 1330edb

Browse files
chrismason-xxDavid Woodhouse
authored andcommitted
sync up with kernel sources
1 parent b218923 commit 1330edb

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ check=sparse $(CHECKFLAGS)
1616
$(check) $<
1717
$(CC) $(CFLAGS) -c $<
1818

19-
all: tester debug-tree quick-test dir-test tags mkfs.btrfs
19+
all: bit-radix-test tester debug-tree quick-test dir-test tags mkfs.btrfs
2020

2121
mkfs.btrfs: $(objects) mkfs.o
2222
gcc $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o
2323

24+
bit-radix-test: $(objects) bit-radix.o
25+
gcc $(CFLAGS) -o bit-radix-test $(objects) bit-radix.o
26+
2427
debug-tree: $(objects) debug-tree.o
2528
gcc $(CFLAGS) -o debug-tree $(objects) debug-tree.o
2629

ctree.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ struct btrfs_trans_handle;
1414
#define BTRFS_FS_TREE_OBJECTID 4
1515
#define BTRFS_FIRST_FREE_OBJECTID 5
1616

17+
#define BTRFS_CSUM_SIZE 32
18+
1719
/*
1820
* the key defines the order in the tree, and so it also defines (optimal)
1921
* block layout. objectid corresonds to the inode number. The flags
@@ -44,7 +46,7 @@ struct btrfs_key {
4446
* every tree block (leaf or node) starts with this header.
4547
*/
4648
struct btrfs_header {
47-
__le32 csum[8];
49+
u8 csum[BTRFS_CSUM_SIZE];
4850
u8 fsid[16]; /* FS specific uuid */
4951
__le64 blocknr; /* which block this node is supposed to live in */
5052
__le64 generation;
@@ -68,8 +70,8 @@ struct btrfs_buffer;
6870
* it currently lacks any block count etc etc
6971
*/
7072
struct btrfs_super_block {
73+
u8 csum[BTRFS_CSUM_SIZE];
7174
/* the first 3 fields must match struct btrfs_header */
72-
__le32 csum[8];
7375
u8 fsid[16]; /* FS specific uuid */
7476
__le64 blocknr; /* this block number */
7577
__le64 magic;
@@ -140,7 +142,7 @@ struct btrfs_extent_item {
140142
} __attribute__ ((__packed__));
141143

142144
struct btrfs_inode_timespec {
143-
__le32 sec;
145+
__le64 sec;
144146
__le32 nsec;
145147
} __attribute__ ((__packed__));
146148

@@ -207,10 +209,15 @@ struct btrfs_file_extent_item {
207209
__le64 num_blocks;
208210
} __attribute__ ((__packed__));
209211

212+
struct btrfs_csum_item {
213+
u8 csum[BTRFS_CSUM_SIZE];
214+
} __attribute__ ((__packed__));
215+
210216
struct btrfs_inode_map_item {
211217
struct btrfs_disk_key key;
212218
} __attribute__ ((__packed__));
213219

220+
214221
struct btrfs_fs_info {
215222
struct btrfs_root *fs_root;
216223
struct btrfs_root *extent_root;

kerncompat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#define __GFP_BITS_SHIFT 20
88
#define __GFP_BITS_MASK ((int)((1 << __GFP_BITS_SHIFT) - 1))
99
#define GFP_KERNEL 0
10+
#define GFP_NOFS 0
1011
#define __read_mostly
1112
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
1213
#define PAGE_SHIFT 12

mkfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ int main(int ac, char **av)
296296
exit(1);
297297
}
298298
memset(buf, 0, 4096);
299-
for(i = 0; i < 6; i++) {
299+
for(i = 0; i < 16; i++) {
300300
ret = write(fd, buf, 4096);
301301
if (ret != 4096) {
302302
fprintf(stderr, "unable to zero fill device\n");

quick-test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ int main(int ac, char **av) {
3030

3131
radix_tree_init();
3232

33-
root = open_ctree("dbfile", &super);
33+
root = open_ctree(av[1], &super);
3434
trans = btrfs_start_transaction(root, 1);
3535
srand(55);
3636
ins.flags = 0;
@@ -51,9 +51,9 @@ int main(int ac, char **av) {
5151
if (i == run_size - 5) {
5252
btrfs_commit_transaction(trans, root, &super);
5353
}
54-
5554
}
5655
close_ctree(root, &super);
56+
exit(1);
5757

5858
root = open_ctree("dbfile", &super);
5959
printf("starting search\n");

0 commit comments

Comments
 (0)