Skip to content

Commit

Permalink
Btrfs: remove device tree
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason authored and David Woodhouse committed Jun 9, 2007
1 parent ad693af commit 0cf6c62
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 413 deletions.
105 changes: 4 additions & 101 deletions fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ extern struct kmem_cache *btrfs_path_cachep;
#define BTRFS_MAGIC "_BtRfS_M"

#define BTRFS_ROOT_TREE_OBJECTID 1ULL
#define BTRFS_DEV_TREE_OBJECTID 2ULL
#define BTRFS_EXTENT_TREE_OBJECTID 3ULL
#define BTRFS_FS_TREE_OBJECTID 4ULL
#define BTRFS_ROOT_TREE_DIR_OBJECTID 5ULL
#define BTRFS_FIRST_FREE_OBJECTID 6ULL
#define BTRFS_EXTENT_TREE_OBJECTID 2ULL
#define BTRFS_FS_TREE_OBJECTID 3ULL
#define BTRFS_ROOT_TREE_DIR_OBJECTID 4ULL
#define BTRFS_FIRST_FREE_OBJECTID 5ULL

/*
* we can actually store much bigger names, but lets not confuse the rest
Expand Down Expand Up @@ -111,12 +110,6 @@ struct btrfs_super_block {
__le64 total_blocks;
__le64 blocks_used;
__le64 root_dir_objectid;
__le64 last_device_id;
/* fields below here vary with the underlying disk */
__le64 device_block_start;
__le64 device_num_blocks;
__le64 device_root;
__le64 device_id;
} __attribute__ ((__packed__));

/*
Expand Down Expand Up @@ -251,11 +244,6 @@ struct btrfs_csum_item {
u8 csum;
} __attribute__ ((__packed__));

struct btrfs_device_item {
__le16 pathlen;
__le64 device_id;
} __attribute__ ((__packed__));

/* tag for the radix tree of block groups in ram */
#define BTRFS_BLOCK_GROUP_DIRTY 0
#define BTRFS_BLOCK_GROUP_AVAIL 1
Expand Down Expand Up @@ -286,11 +274,9 @@ struct btrfs_fs_info {
spinlock_t hash_lock;
struct btrfs_root *extent_root;
struct btrfs_root *tree_root;
struct btrfs_root *dev_root;
struct radix_tree_root fs_roots_radix;
struct radix_tree_root pending_del_radix;
struct radix_tree_root pinned_radix;
struct radix_tree_root dev_radix;
struct radix_tree_root block_group_radix;
struct radix_tree_root block_group_data_radix;
struct radix_tree_root extent_map_radix;
Expand Down Expand Up @@ -385,11 +371,6 @@ struct btrfs_root {
*/
#define BTRFS_BLOCK_GROUP_ITEM_KEY 34

/*
* dev items list the devices that make up the FS
*/
#define BTRFS_DEV_ITEM_KEY 35

/*
* string items are for debugging. They just store a short string of
* data in the FS
Expand Down Expand Up @@ -880,62 +861,6 @@ static inline void btrfs_set_super_root_dir(struct btrfs_super_block *s, u64
s->root_dir_objectid = cpu_to_le64(val);
}

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

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

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

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

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

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

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

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

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

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


static inline u8 *btrfs_leaf_data(struct btrfs_leaf *l)
{
return (u8 *)l->items;
Expand Down Expand Up @@ -1031,28 +956,6 @@ static inline void btrfs_set_file_extent_num_blocks(struct
e->num_blocks = cpu_to_le64(val);
}

static inline u16 btrfs_device_pathlen(struct btrfs_device_item *d)
{
return le16_to_cpu(d->pathlen);
}

static inline void btrfs_set_device_pathlen(struct btrfs_device_item *d,
u16 val)
{
d->pathlen = cpu_to_le16(val);
}

static inline u64 btrfs_device_id(struct btrfs_device_item *d)
{
return le64_to_cpu(d->device_id);
}

static inline void btrfs_set_device_id(struct btrfs_device_item *d,
u64 val)
{
d->device_id = cpu_to_le64(val);
}

static inline struct btrfs_root *btrfs_sb(struct super_block *sb)
{
return sb->s_fs_info;
Expand Down
Loading

0 comments on commit 0cf6c62

Please sign in to comment.