]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/btrfs/ctree.h
Btrfs: fix ioctl-initiated transactions vs wait_current_trans()
[mirror_ubuntu-artful-kernel.git] / fs / btrfs / ctree.h
index 07d321552dbe85887ee073295be2c202eaaa42c0..62499dd761b7836ead5b84af42d7f2e38a48b69b 100644 (file)
@@ -518,6 +518,7 @@ struct btrfs_fs_info {
 
        u64 generation;
        u64 last_trans_committed;
+       u64 open_ioctl_trans;
        unsigned long mount_opt;
        u64 max_extent;
        u64 max_inline;
@@ -580,6 +581,7 @@ struct btrfs_fs_info {
        int do_barriers;
        int closing;
        atomic_t throttles;
+       atomic_t throttle_gen;
 
        u64 total_pinned;
        struct list_head dirty_cowonly_roots;
@@ -592,6 +594,9 @@ struct btrfs_fs_info {
        u64 last_alloc;
        u64 last_data_alloc;
 
+       spinlock_t ref_cache_lock;
+       u64 total_ref_cache_size;
+
        u64 avail_data_alloc_bits;
        u64 avail_metadata_alloc_bits;
        u64 avail_system_alloc_bits;
@@ -602,10 +607,18 @@ struct btrfs_fs_info {
        void *bdev_holder;
 };
 
+struct btrfs_leaf_ref_tree {
+       struct rb_root root;
+       struct btrfs_leaf_ref *last;
+       struct list_head list;
+       spinlock_t lock;
+};
+
 /*
  * in ram representation of the tree.  extent_root is used for all allocations
  * and for the extent tree extent_root root.
  */
+struct btrfs_dirty_root;
 struct btrfs_root {
        struct extent_buffer *node;
 
@@ -613,6 +626,10 @@ struct btrfs_root {
        spinlock_t node_lock;
 
        struct extent_buffer *commit_root;
+       struct btrfs_leaf_ref_tree *ref_tree;
+       struct btrfs_leaf_ref_tree ref_tree_struct;
+       struct btrfs_dirty_root *dirty_root;
+
        struct btrfs_root_item root_item;
        struct btrfs_key root_key;
        struct btrfs_fs_info *fs_info;
@@ -650,7 +667,8 @@ struct btrfs_root {
        /* the dirty list is only used by non-reference counted roots */
        struct list_head dirty_list;
 
-       spinlock_t orphan_lock;
+       spinlock_t list_lock;
+       struct list_head dead_list;
        struct list_head orphan_list;
 };
 
@@ -1383,9 +1401,8 @@ static inline struct dentry *fdentry(struct file *file) {
 }
 
 /* extent-tree.c */
-u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
-                                 struct btrfs_path *count_path,
-                                 u64 expected_owner, u64 first_extent);
+int btrfs_cross_ref_exists(struct btrfs_root *root,
+                          struct btrfs_key *key, u64 bytenr);
 int btrfs_extent_post_op(struct btrfs_trans_handle *trans,
                         struct btrfs_root *root);
 int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy);
@@ -1405,6 +1422,9 @@ struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
                                             int level,
                                             u64 hint,
                                             u64 empty_size);
+struct extent_buffer *btrfs_init_new_buffer(struct btrfs_trans_handle *trans,
+                                           struct btrfs_root *root,
+                                           u64 bytenr, u32 blocksize);
 int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 new_size);
 int btrfs_insert_extent_backref(struct btrfs_trans_handle *trans,
                                 struct btrfs_root *root,
@@ -1430,11 +1450,12 @@ int btrfs_reserve_extent(struct btrfs_trans_handle *trans,
                                  u64 search_end, struct btrfs_key *ins,
                                  u64 data);
 int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
-                 struct extent_buffer *buf);
+                 struct extent_buffer *buf, int cache_ref);
 int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
                      *root, u64 bytenr, u64 num_bytes,
                      u64 root_objectid, u64 ref_generation,
                      u64 owner_objectid, u64 owner_offset, int pin);
+int btrfs_free_reserved_extent(struct btrfs_root *root, u64 start, u64 len);
 int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans,
                               struct btrfs_root *root,
                               struct extent_io_tree *unpin);
@@ -1468,7 +1489,7 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,
 int btrfs_cow_block(struct btrfs_trans_handle *trans,
                    struct btrfs_root *root, struct extent_buffer *buf,
                    struct extent_buffer *parent, int parent_slot,
-                   struct extent_buffer **cow_ret);
+                   struct extent_buffer **cow_ret, u64 prealloc_dest);
 int btrfs_copy_root(struct btrfs_trans_handle *trans,
                      struct btrfs_root *root,
                      struct extent_buffer *buf,
@@ -1597,6 +1618,8 @@ int btrfs_lookup_inode(struct btrfs_trans_handle *trans, struct btrfs_root
                       struct btrfs_key *location, int mod);
 
 /* file-item.c */
+int btrfs_lookup_bio_sums(struct btrfs_root *root, struct inode *inode,
+                         struct bio *bio);
 int btrfs_insert_file_extent(struct btrfs_trans_handle *trans,
                               struct btrfs_root *root,
                               u64 objectid, u64 pos, u64 disk_offset,