Merge branch 'qgroup' of git://git.jan-o-sch.net/btrfs-unstable into for-linus
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / btrfs / ctree.h
index 2ba03b96fbe056090ba901b70be94f65def94700..00f9a50f986d95615e6affb651bf52510519396b 100644 (file)
@@ -1319,6 +1319,8 @@ struct btrfs_fs_info {
         */
        struct list_head space_info;
 
+       struct btrfs_space_info *data_sinfo;
+
        struct reloc_control *reloc_ctl;
 
        spinlock_t delalloc_lock;
@@ -1747,13 +1749,54 @@ static inline void btrfs_init_map_token (struct btrfs_map_token *token)
                            offsetof(type, member),                     \
                           sizeof(((type *)0)->member)))
 
-#ifndef BTRFS_SETGET_FUNCS
+#define DECLARE_BTRFS_SETGET_BITS(bits)                                        \
+u##bits btrfs_get_token_##bits(struct extent_buffer *eb, void *ptr,    \
+                              unsigned long off,                       \
+                              struct btrfs_map_token *token);          \
+void btrfs_set_token_##bits(struct extent_buffer *eb, void *ptr,       \
+                           unsigned long off, u##bits val,             \
+                           struct btrfs_map_token *token);             \
+static inline u##bits btrfs_get_##bits(struct extent_buffer *eb, void *ptr, \
+                                      unsigned long off)               \
+{                                                                      \
+       return btrfs_get_token_##bits(eb, ptr, off, NULL);              \
+}                                                                      \
+static inline void btrfs_set_##bits(struct extent_buffer *eb, void *ptr, \
+                                   unsigned long off, u##bits val)     \
+{                                                                      \
+       btrfs_set_token_##bits(eb, ptr, off, val, NULL);                        \
+}
+
+DECLARE_BTRFS_SETGET_BITS(8)
+DECLARE_BTRFS_SETGET_BITS(16)
+DECLARE_BTRFS_SETGET_BITS(32)
+DECLARE_BTRFS_SETGET_BITS(64)
+
 #define BTRFS_SETGET_FUNCS(name, type, member, bits)                   \
-u##bits btrfs_##name(struct extent_buffer *eb, type *s);               \
-u##bits btrfs_token_##name(struct extent_buffer *eb, type *s, struct btrfs_map_token *token);          \
-void btrfs_set_token_##name(struct extent_buffer *eb, type *s, u##bits val, struct btrfs_map_token *token);\
-void btrfs_set_##name(struct extent_buffer *eb, type *s, u##bits val);
-#endif
+static inline u##bits btrfs_##name(struct extent_buffer *eb, type *s)  \
+{                                                                      \
+       BUILD_BUG_ON(sizeof(u##bits) != sizeof(((type *)0))->member);   \
+       return btrfs_get_##bits(eb, s, offsetof(type, member));         \
+}                                                                      \
+static inline void btrfs_set_##name(struct extent_buffer *eb, type *s, \
+                                   u##bits val)                        \
+{                                                                      \
+       BUILD_BUG_ON(sizeof(u##bits) != sizeof(((type *)0))->member);   \
+       btrfs_set_##bits(eb, s, offsetof(type, member), val);           \
+}                                                                      \
+static inline u##bits btrfs_token_##name(struct extent_buffer *eb, type *s, \
+                                        struct btrfs_map_token *token) \
+{                                                                      \
+       BUILD_BUG_ON(sizeof(u##bits) != sizeof(((type *)0))->member);   \
+       return btrfs_get_token_##bits(eb, s, offsetof(type, member), token); \
+}                                                                      \
+static inline void btrfs_set_token_##name(struct extent_buffer *eb,    \
+                                         type *s, u##bits val,         \
+                                         struct btrfs_map_token *token)        \
+{                                                                      \
+       BUILD_BUG_ON(sizeof(u##bits) != sizeof(((type *)0))->member);   \
+       btrfs_set_token_##bits(eb, s, offsetof(type, member), val, token); \
+}
 
 #define BTRFS_SETGET_HEADER_FUNCS(name, type, member, bits)            \
 static inline u##bits btrfs_##name(struct extent_buffer *eb)           \
@@ -2776,7 +2819,6 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
                             struct btrfs_root *root, u64 group_start);
 u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags);
 u64 btrfs_get_alloc_profile(struct btrfs_root *root, int data);
-void btrfs_set_inode_space_info(struct btrfs_root *root, struct inode *ionde);
 void btrfs_clear_space_info_full(struct btrfs_fs_info *info);
 int btrfs_check_data_free_space(struct inode *inode, u64 bytes);
 void btrfs_free_reserved_data_space(struct inode *inode, u64 bytes);
@@ -3166,7 +3208,6 @@ int btrfs_readpage(struct file *file, struct page *page);
 void btrfs_evict_inode(struct inode *inode);
 int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc);
 int btrfs_dirty_inode(struct inode *inode);
-int btrfs_update_time(struct file *file);
 struct inode *btrfs_alloc_inode(struct super_block *sb);
 void btrfs_destroy_inode(struct inode *inode);
 int btrfs_drop_inode(struct inode *inode);