btrfs: introduce delayed_refs_rsv
[sfrench/cifs-2.6.git] / fs / btrfs / ctree.h
index 5fb4cb646c82377cf8008a3ccc5a87607d7fb842..ab9d9ed20e0cf67fb59acc01feb1eb51a7405360 100644 (file)
@@ -468,6 +468,7 @@ enum {
        BTRFS_BLOCK_RSV_TRANS,
        BTRFS_BLOCK_RSV_CHUNK,
        BTRFS_BLOCK_RSV_DELOPS,
+       BTRFS_BLOCK_RSV_DELREFS,
        BTRFS_BLOCK_RSV_EMPTY,
        BTRFS_BLOCK_RSV_TEMP,
 };
@@ -831,6 +832,8 @@ struct btrfs_fs_info {
        struct btrfs_block_rsv chunk_block_rsv;
        /* block reservation for delayed operations */
        struct btrfs_block_rsv delayed_block_rsv;
+       /* block reservation for delayed refs */
+       struct btrfs_block_rsv delayed_refs_rsv;
 
        struct btrfs_block_rsv empty_block_rsv;
 
@@ -2816,6 +2819,13 @@ int btrfs_cond_migrate_bytes(struct btrfs_fs_info *fs_info,
 void btrfs_block_rsv_release(struct btrfs_fs_info *fs_info,
                             struct btrfs_block_rsv *block_rsv,
                             u64 num_bytes);
+void btrfs_delayed_refs_rsv_release(struct btrfs_fs_info *fs_info, int nr);
+void btrfs_update_delayed_refs_rsv(struct btrfs_trans_handle *trans);
+int btrfs_delayed_refs_rsv_refill(struct btrfs_fs_info *fs_info,
+                                 enum btrfs_reserve_flush_enum flush);
+void btrfs_migrate_to_delayed_refs_rsv(struct btrfs_fs_info *fs_info,
+                                      struct btrfs_block_rsv *src,
+                                      u64 num_bytes);
 int btrfs_inc_block_group_ro(struct btrfs_block_group_cache *cache);
 void btrfs_dec_block_group_ro(struct btrfs_block_group_cache *cache);
 void btrfs_put_block_group_cache(struct btrfs_fs_info *info);