Skip to content

Commit 65a545f

Browse files
chrismason-xxDavid Woodhouse
authored and
David Woodhouse
committed
i386 fixes from axboe
1 parent d9f1317 commit 65a545f

File tree

4 files changed

+65
-4
lines changed

4 files changed

+65
-4
lines changed

INSTALL

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Install Instructions
2+
3+
Btrfs puts snapshots and subvolumes into the root directory of the FS. This
4+
directory can only be changed by btrfsctl right now, and normal filesystem
5+
operations do not work on it. The default subvolume is called 'default',
6+
and you can create files and directories in mount_point/default
7+
8+
Btrfs uses the crypto manager interface in the kernel for file and
9+
metadata checksums. You need to compile the kernel with:
10+
11+
CONFIG_CRYPTO=y
12+
CONFIG_CRYPTO_MANAGER=m
13+
CONFIG_CRYPTO_CRC32C=m
14+
15+
cryptomanager and crc32c can be static as well. Once your kernel is
16+
setup, typing make in the btrfs module sources will build against the
17+
running kernel. When the build is complete:
18+
19+
modprobe crc32c
20+
modprobe cryptomgr
21+
insmod btrfs.ko
22+
23+
The Btrfs utility programs require libuuid to build. This can be found
24+
in the e2fsprogs sources, and is usually available as libuuid or
25+
e2fsprogs-devel from various distros.
26+
27+
Building the utilities is just make ; make install. The programs go
28+
into /usr/local/bin. The commands available are:
29+
30+
mkfs.btrfs: create a filesystem
31+
32+
btrfsctl: control program to create snapshots and subvolumes:
33+
34+
mount /dev/sda2 /mnt
35+
btrfsctl -s new_subvol_name /mnt
36+
btrfsctl -s snapshot_of_default /mnt/default
37+
btrfsctl -s snapshot_of_new_subvol /mnt/new_subvol_name
38+
btrfsctl -s snapshot_of_a_snapshot /mnt/snapshot_of_new_subvol
39+
ls /mnt
40+
default snapshot_of_a_snapshot snapshot_of_new_subvol
41+
new_subvol_name snapshot_of_default
42+
43+
Snapshots and subvolumes cannot be deleted right now, but you can
44+
rm -rf all the files and directories inside them.
45+
46+
btrfsck: do a limited check of the FS extent trees.</li>
47+
48+
debug-tree: print all of the FS metadata in text form. Example:
49+
50+
debug-tree /dev/sda2 >& big_output_file
51+

kerncompat.h

+10-3
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ struct page {
7171
unsigned long index;
7272
};
7373

74-
static inline void preempt_enable(void) { do {; } while(0);}
75-
static inline void preempt_disable(void) { do {; } while(0);}
74+
#define preempt_enable() do { } while (0)
75+
#define preempt_disable() do { } while (0)
7676

7777
#define BITOP_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
7878
#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
@@ -114,9 +114,16 @@ static inline int test_bit(int nr, const volatile unsigned long *addr)
114114

115115
#define BUG_ON(c) do { if (c) abort(); } while (0)
116116

117+
#undef offsetof
118+
#ifdef __compiler_offsetof
119+
#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
120+
#else
121+
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
122+
#endif
123+
117124
#define container_of(ptr, type, member) ({ \
118125
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
119-
(type *)( (char *)__mptr - __builtin_offsetof(type,member) );})
126+
(type *)( (char *)__mptr - offsetof(type,member) );})
120127

121128
#define ENOMEM 5
122129
#define EEXIST 6

mkfs.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
#include <fcntl.h>
2929
#include <unistd.h>
3030
#include <uuid/uuid.h>
31-
#include "kerncompat.h"
3231
#include "radix-tree.h"
32+
#include <linux/fs.h>
33+
#include "kerncompat.h"
3334
#include "ctree.h"
3435
#include "disk-io.h"
3536
#include "transaction.h"

radix-tree.h

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
#ifndef _LINUX_RADIX_TREE_H
3838
#define _LINUX_RADIX_TREE_H
3939

40+
#include "kerncompat.h"
41+
4042
#define RADIX_TREE_MAX_TAGS 2
4143

4244
/* root tags are stored in gfp_mask, shifted by __GFP_BITS_SHIFT */

0 commit comments

Comments
 (0)