Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128294
b: refs/heads/master
c: 2e635a2
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason authored and David Woodhouse committed Mar 21, 2007
1 parent 9d55216 commit c59399c
Show file tree
Hide file tree
Showing 25 changed files with 275 additions and 2,912 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1261ec42b3d3a3ad878bd172144940e3ac710749
refs/heads/master: 2e635a278354a1a7951e16cfea4c247d6d0e7c99
50 changes: 15 additions & 35 deletions trunk/fs/btrfs/Makefile
Original file line number Diff line number Diff line change
@@ -1,40 +1,20 @@
CC=gcc
CFLAGS = -g -Wall -Werror
headers = radix-tree.h ctree.h disk-io.h kerncompat.h print-tree.h list.h \
transaction.h
objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
root-tree.o dir-item.o hash.o file-item.o inode-item.o \
inode-map.o \
ifneq ($(KERNELRELEASE),)
# kbuild part of makefile

# if you don't have sparse installed, use ls instead
CHECKFLAGS=-D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise \
-Wcontext -Wcast-truncate -Wuninitialized -Wshadow -Wundef
check=sparse $(CHECKFLAGS)
#check=ls
obj-m := btrfs.o
btrfs-y := super.o

.c.o:
$(check) $<
$(CC) $(CFLAGS) -c $<
#btrfs-y := ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
# root-tree.o dir-item.o hash.o file-item.o inode-item.o \
# inode-map.o \
all: tester debug-tree quick-test dir-test tags mkfs.btrfs

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

debug-tree: $(objects) debug-tree.o
gcc $(CFLAGS) -o debug-tree $(objects) debug-tree.o

tester: $(objects) random-test.o
gcc $(CFLAGS) -o tester $(objects) random-test.o

dir-test: $(objects) dir-test.o
gcc $(CFLAGS) -o dir-test $(objects) dir-test.o
quick-test: $(objects) quick-test.o
gcc $(CFLAGS) -o quick-test $(objects) quick-test.o

$(objects): $(headers)

clean :
rm debug-tree tester *.o
else

# Normal Makefile

KERNELDIR := /lib/modules/`uname -r`/build
all::
$(MAKE) -C $(KERNELDIR) M=`pwd` modules
clean::
rm *.o btrfs.ko
endif
6 changes: 1 addition & 5 deletions trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include "kerncompat.h"
#include "radix-tree.h"
#include <linux/module.h>
#include "ctree.h"
#include "disk-io.h"
#include "print-tree.h"

static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root
*root, struct btrfs_path *path, int level);
Expand Down
15 changes: 12 additions & 3 deletions trunk/fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef __BTRFS__
#define __BTRFS__

#include "list.h"
#include "kerncompat.h"

struct btrfs_trans_handle;

#define BTRFS_MAGIC "_BtRfS_M"
Expand Down Expand Up @@ -75,6 +72,7 @@ struct btrfs_super_block {
__le64 root;
__le64 total_blocks;
__le64 blocks_used;
__le64 root_dir_objectid;
} __attribute__ ((__packed__));

/*
Expand Down Expand Up @@ -693,6 +691,17 @@ static inline void btrfs_set_super_blocksize(struct btrfs_super_block *s,
s->blocksize = cpu_to_le32(val);
}

static inline u64 btrfs_super_root_dir(struct btrfs_super_block *s)
{
return le64_to_cpu(s->root_dir_objectid);
}

static inline void btrfs_set_super_root_dir(struct btrfs_super_block *s, u64
val)
{
s->root_dir_objectid = cpu_to_le64(val);
}

static inline u8 *btrfs_leaf_data(struct btrfs_leaf *l)
{
return (u8 *)l->items;
Expand Down
38 changes: 0 additions & 38 deletions trunk/fs/btrfs/debug-tree.c

This file was deleted.

12 changes: 7 additions & 5 deletions trunk/fs/btrfs/dir-item.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#include <stdio.h>
#include <stdlib.h>
#include "kerncompat.h"
#include "radix-tree.h"
#include <linux/module.h>
#include "ctree.h"
#include "disk-io.h"
#include "hash.h"
Expand All @@ -21,7 +18,12 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
key.objectid = dir;
key.flags = 0;
btrfs_set_key_type(&key, BTRFS_DIR_ITEM_KEY);
ret = btrfs_name_hash(name, name_len, &key.offset);
if (name_len == 1 && *name == '.')
key.offset = 1;
else if (name_len == 2 && name[0] == '.' && name[1] == '.')
key.offset = 2;
else
ret = btrfs_name_hash(name, name_len, &key.offset);
BUG_ON(ret);
btrfs_init_path(&path);
data_size = sizeof(*dir_item) + name_len;
Expand Down
Loading

0 comments on commit c59399c

Please sign in to comment.