btrfs: rename do_chunk_alloc to btrfs_chunk_alloc
[sfrench/cifs-2.6.git] / fs / btrfs / ctree.h
index 1d6a60f437a62d78e0cf57306aae1bb9b16295d5..8fca40370cf1d5d480b6fac3f2d73bb041971b28 100644 (file)
@@ -2780,6 +2780,28 @@ enum btrfs_flush_state {
        COMMIT_TRANS            =       9,
 };
 
+/*
+ * control flags for do_chunk_alloc's force field
+ * CHUNK_ALLOC_NO_FORCE means to only allocate a chunk
+ * if we really need one.
+ *
+ * CHUNK_ALLOC_LIMITED means to only try and allocate one
+ * if we have very few chunks already allocated.  This is
+ * used as part of the clustering code to help make sure
+ * we have a good pool of storage to cluster in, without
+ * filling the FS with empty chunks
+ *
+ * CHUNK_ALLOC_FORCE means it must try to allocate one
+ *
+ */
+enum btrfs_chunk_alloc_enum {
+       CHUNK_ALLOC_NO_FORCE,
+       CHUNK_ALLOC_LIMITED,
+       CHUNK_ALLOC_FORCE,
+};
+
+int btrfs_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags,
+                     enum btrfs_chunk_alloc_enum force);
 int btrfs_alloc_data_chunk_ondemand(struct btrfs_inode *inode, u64 bytes);
 int btrfs_check_data_free_space(struct inode *inode,
                        struct extent_changeset **reserved, u64 start, u64 len);