u8 fsid[16]; /* FS specific uuid */
__le64 blocknr; /* which block this node is supposed to live in */
__le64 generation;
+ __le64 owner;
__le16 nritems;
__le16 flags;
u8 level;
*/
struct btrfs_extent_item {
__le32 refs;
+ __le64 owner;
} __attribute__ ((__packed__));
struct btrfs_inode_timespec {
struct btrfs_root *extent_root;
struct btrfs_root *tree_root;
struct btrfs_root *dev_root;
- struct btrfs_key current_insert;
struct btrfs_key last_insert;
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;
+
+ u64 extent_tree_insert[BTRFS_MAX_LEVEL * 3];
+ int extent_tree_insert_nr;
+ u64 extent_tree_prealloc[BTRFS_MAX_LEVEL * 3];
+ int extent_tree_prealloc_nr;
+
u64 generation;
struct btrfs_transaction *running_transaction;
struct btrfs_super_block *disk_super;
struct list_head trans_list;
struct crypto_hash *hash_tfm;
spinlock_t hash_lock;
+ int do_barriers;
struct kobject kobj;
};
/*
* in ram representation of the tree. extent_root is used for all allocations
- * and for the extent tree extent_root root. current_insert is used
- * only for the extent tree.
+ * and for the extent tree extent_root root.
*/
struct btrfs_root {
struct buffer_head *node;
ei->refs = cpu_to_le32(val);
}
+static inline u64 btrfs_extent_owner(struct btrfs_extent_item *ei)
+{
+ return le64_to_cpu(ei->owner);
+}
+
+static inline void btrfs_set_extent_owner(struct btrfs_extent_item *ei, u64 val)
+{
+ ei->owner = cpu_to_le64(val);
+}
+
static inline u64 btrfs_node_blockptr(struct btrfs_node *n, int nr)
{
return le64_to_cpu(n->ptrs[nr].blockptr);
}
+
static inline void btrfs_set_node_blockptr(struct btrfs_node *n, int nr,
u64 val)
{
h->generation = cpu_to_le64(val);
}
+static inline u64 btrfs_header_owner(struct btrfs_header *h)
+{
+ return le64_to_cpu(h->owner);
+}
+
+static inline void btrfs_set_header_owner(struct btrfs_header *h,
+ u64 val)
+{
+ h->owner = cpu_to_le64(val);
+}
+
static inline u16 btrfs_header_nritems(struct btrfs_header *h)
{
return le16_to_cpu(h->nritems);
struct btrfs_root *root);
struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
struct btrfs_root *root);
-int btrfs_alloc_extent(struct btrfs_trans_handle *trans, struct btrfs_root
- *root, u64 num_blocks, u64 search_start, u64
- search_end, struct btrfs_key *ins);
+int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root, u64 owner,
+ u64 num_blocks, u64 search_start,
+ u64 search_end, struct btrfs_key *ins);
int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
struct buffer_head *buf);
int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root