btrfs-progs: tests: disable some mkfs/010 testcases inside travis
[platform/upstream/btrfs-progs.git] / ctree.h
diff --git a/ctree.h b/ctree.h
index b5f6ea6..f409730 100644 (file)
--- a/ctree.h
+++ b/ctree.h
@@ -19,6 +19,8 @@
 #ifndef __BTRFS_CTREE_H__
 #define __BTRFS_CTREE_H__
 
+#include <stdbool.h>
+
 #if BTRFS_FLAT_INCLUDES
 #include "list.h"
 #include "kerncompat.h"
@@ -2070,6 +2072,38 @@ BTRFS_SETGET_STACK_FUNCS(root_stransid, struct btrfs_root_item,
 BTRFS_SETGET_STACK_FUNCS(root_rtransid, struct btrfs_root_item,
                         rtransid, 64);
 
+static inline struct btrfs_timespec* btrfs_root_ctime(
+               struct btrfs_root_item *root_item)
+{
+       unsigned long ptr = (unsigned long)root_item;
+       ptr += offsetof(struct btrfs_root_item, ctime);
+       return (struct btrfs_timespec *)ptr;
+}
+
+static inline struct btrfs_timespec* btrfs_root_otime(
+               struct btrfs_root_item *root_item)
+{
+       unsigned long ptr = (unsigned long)root_item;
+       ptr += offsetof(struct btrfs_root_item, otime);
+       return (struct btrfs_timespec *)ptr;
+}
+
+static inline struct btrfs_timespec* btrfs_root_stime(
+               struct btrfs_root_item *root_item)
+{
+       unsigned long ptr = (unsigned long)root_item;
+       ptr += offsetof(struct btrfs_root_item, stime);
+       return (struct btrfs_timespec *)ptr;
+}
+
+static inline struct btrfs_timespec* btrfs_root_rtime(
+               struct btrfs_root_item *root_item)
+{
+       unsigned long ptr = (unsigned long)root_item;
+       ptr += offsetof(struct btrfs_root_item, rtime);
+       return (struct btrfs_timespec *)ptr;
+}
+
 /* struct btrfs_root_backup */
 BTRFS_SETGET_STACK_FUNCS(backup_tree_root, struct btrfs_root_backup,
                   tree_root, 64);
@@ -2433,7 +2467,7 @@ int btrfs_reserve_extent(struct btrfs_trans_handle *trans,
                         struct btrfs_root *root,
                         u64 num_bytes, u64 empty_size,
                         u64 hint_byte, u64 search_end,
-                        struct btrfs_key *ins, int data);
+                        struct btrfs_key *ins, bool is_data);
 int btrfs_fix_block_accounting(struct btrfs_trans_handle *trans,
                                 struct btrfs_root *root);
 void btrfs_pin_extent(struct btrfs_fs_info *fs_info, u64 bytenr, u64 num_bytes);
@@ -2495,15 +2529,13 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info);
 int btrfs_read_block_groups(struct btrfs_root *root);
 struct btrfs_block_group_cache *
 btrfs_add_block_group(struct btrfs_fs_info *fs_info, u64 bytes_used, u64 type,
-                     u64 chunk_objectid, u64 chunk_offset, u64 size);
+                     u64 chunk_offset, u64 size);
 int btrfs_make_block_group(struct btrfs_trans_handle *trans,
                           struct btrfs_fs_info *fs_info, u64 bytes_used,
-                          u64 type, u64 chunk_objectid, u64 chunk_offset,
-                          u64 size);
+                          u64 type, u64 chunk_offset, u64 size);
 int btrfs_make_block_groups(struct btrfs_trans_handle *trans,
                            struct btrfs_fs_info *fs_info);
-int btrfs_update_block_group(struct btrfs_trans_handle *trans,
-                            struct btrfs_root *root, u64 bytenr, u64 num,
+int btrfs_update_block_group(struct btrfs_root *root, u64 bytenr, u64 num,
                             int alloc, int mark_free);
 int btrfs_record_file_extent(struct btrfs_trans_handle *trans,
                              struct btrfs_root *root, u64 objectid,
@@ -2736,7 +2768,7 @@ int btrfs_change_inode_flags(struct btrfs_trans_handle *trans,
                             struct btrfs_root *root, u64 ino, u64 flags);
 int btrfs_add_link(struct btrfs_trans_handle *trans, struct btrfs_root *root,
                   u64 ino, u64 parent_ino, char *name, int namelen,
-                  u8 type, u64 *index, int add_backref);
+                  u8 type, u64 *index, int add_backref, int ignore_existed);
 int btrfs_unlink(struct btrfs_trans_handle *trans, struct btrfs_root *root,
                 u64 ino, u64 parent_ino, u64 index, const char *name,
                 int namelen, int add_orphan);
@@ -2745,6 +2777,8 @@ int btrfs_add_orphan_item(struct btrfs_trans_handle *trans,
                          u64 ino);
 int btrfs_mkdir(struct btrfs_trans_handle *trans, struct btrfs_root *root,
                char *name, int namelen, u64 parent_ino, u64 *ino, int mode);
+struct btrfs_root *btrfs_mksubvol(struct btrfs_root *root, const char *base,
+                                 u64 root_objectid, bool convert);
 
 /* file.c */
 int btrfs_get_extent(struct btrfs_trans_handle *trans,