]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/btrfs/ctree.h
Btrfs: Add mount -o degraded to allow mounts to continue with missing devices
[karo-tx-linux.git] / fs / btrfs / ctree.h
index ac7106ec5357000b532803b39a5bc858d4bb92d9..a9377fb16c373d870037ea3328d1bfe64a50a4cb 100644 (file)
@@ -505,7 +505,7 @@ struct btrfs_fs_info {
        u64 alloc_start;
        struct btrfs_transaction *running_transaction;
        struct btrfs_super_block super_copy;
-       struct extent_buffer *sb_buffer;
+       struct btrfs_super_block super_for_commit;
        struct block_device *__bdev;
        struct super_block *sb;
        struct inode *btree_inode;
@@ -551,6 +551,8 @@ struct btrfs_fs_info {
        u64 data_alloc_profile;
        u64 metadata_alloc_profile;
        u64 system_alloc_profile;
+
+       void *bdev_holder;
 };
 
 /*
@@ -655,6 +657,7 @@ struct btrfs_root {
 #define BTRFS_MOUNT_NODATACOW          (1 << 1)
 #define BTRFS_MOUNT_NOBARRIER          (1 << 2)
 #define BTRFS_MOUNT_SSD                        (1 << 3)
+#define BTRFS_MOUNT_DEGRADED           (1 << 4)
 
 #define btrfs_clear_opt(o, opt)                ((o) &= ~BTRFS_MOUNT_##opt)
 #define btrfs_set_opt(o, opt)          ((o) |= BTRFS_MOUNT_##opt)
@@ -1206,6 +1209,7 @@ BTRFS_SETGET_STACK_FUNCS(root_limit, struct btrfs_root_item, byte_limit, 64);
 
 /* struct btrfs_super_block */
 BTRFS_SETGET_STACK_FUNCS(super_bytenr, struct btrfs_super_block, bytenr, 64);
+BTRFS_SETGET_STACK_FUNCS(super_flags, struct btrfs_super_block, flags, 64);
 BTRFS_SETGET_STACK_FUNCS(super_generation, struct btrfs_super_block,
                         generation, 64);
 BTRFS_SETGET_STACK_FUNCS(super_root, struct btrfs_super_block, root, 64);
@@ -1322,7 +1326,7 @@ 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 first_extent);
+                                 u64 expected_owner, u64 first_extent);
 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);
@@ -1362,7 +1366,7 @@ int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
                       u64 root_objectid, u64 ref_generation,
                       u64 owner, u64 owner_offset,
                       u64 empty_size, u64 hint_byte,
-                      u64 search_end, struct btrfs_key *ins, int data);
+                      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);
 int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
@@ -1456,6 +1460,8 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
                      *item);
 int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct
                         btrfs_root_item *item, struct btrfs_key *key);
+int btrfs_search_root(struct btrfs_root *root, u64 search_start,
+                     u64 *found_objectid);
 int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid,
                          struct btrfs_root *latest_root);
 /* dir-item.c */
@@ -1514,9 +1520,9 @@ int btrfs_lookup_inode(struct btrfs_trans_handle *trans, struct btrfs_root
 /* file-item.c */
 int btrfs_insert_file_extent(struct btrfs_trans_handle *trans,
                               struct btrfs_root *root,
-                              u64 objectid, u64 pos, u64 offset,
+                              u64 objectid, u64 pos, u64 disk_offset,
                               u64 disk_num_bytes,
-                              u64 num_bytes);
+                            u64 num_bytes, u64 offset);
 int btrfs_lookup_file_extent(struct btrfs_trans_handle *trans,
                             struct btrfs_root *root,
                             struct btrfs_path *path, u64 objectid,
@@ -1601,4 +1607,6 @@ int btrfs_delete_xattrs(struct btrfs_trans_handle *trans,
                        struct btrfs_root *root, struct inode *inode);
 /* super.c */
 u64 btrfs_parse_size(char *str);
+int btrfs_parse_options(char *options, struct btrfs_root *root,
+                       char **subvol_name);
 #endif