Merge tag 'pm-5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
[linux-2.6-microblaze.git] / fs / btrfs / ctree.h
index e6e3759..9ae776a 100644 (file)
@@ -298,7 +298,8 @@ struct btrfs_super_block {
         BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA |       \
         BTRFS_FEATURE_INCOMPAT_NO_HOLES        |       \
         BTRFS_FEATURE_INCOMPAT_METADATA_UUID   |       \
-        BTRFS_FEATURE_INCOMPAT_RAID1C34)
+        BTRFS_FEATURE_INCOMPAT_RAID1C34        |       \
+        BTRFS_FEATURE_INCOMPAT_ZONED)
 
 #define BTRFS_FEATURE_INCOMPAT_SAFE_SET                        \
        (BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF)
@@ -523,6 +524,11 @@ struct btrfs_swapfile_pin {
         * points to a struct btrfs_device.
         */
        bool is_block_group;
+       /*
+        * Only used when 'is_block_group' is true and it is the number of
+        * extents used by a swapfile for this block group ('ptr' field).
+        */
+       int bg_extent_count;
 };
 
 bool btrfs_pinned_by_swapfile(struct btrfs_fs_info *fs_info, void *ptr);
@@ -563,6 +569,9 @@ enum {
 
        /* Indicate that we need to cleanup space cache v1 */
        BTRFS_FS_CLEANUP_SPACE_CACHE_V1,
+
+       /* Indicate that we can't trust the free space tree for caching yet */
+       BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED,
 };
 
 /*
@@ -794,7 +803,7 @@ struct btrfs_fs_info {
        /* used to keep from writing metadata until there is a nice batch */
        struct percpu_counter dirty_metadata_bytes;
        struct percpu_counter delalloc_bytes;
-       struct percpu_counter dio_bytes;
+       struct percpu_counter ordered_bytes;
        s32 dirty_metadata_batch;
        s32 delalloc_batch;
 
@@ -930,6 +939,7 @@ struct btrfs_fs_info {
        /* Used to reclaim the metadata space in the background. */
        struct work_struct async_reclaim_work;
        struct work_struct async_data_reclaim_work;
+       struct work_struct preempt_reclaim_work;
 
        spinlock_t unused_bgs_lock;
        struct list_head unused_bgs;
@@ -971,6 +981,9 @@ struct btrfs_fs_info {
 
        /* Max size to emit ZONE_APPEND write command */
        u64 max_zone_append_size;
+       struct mutex zoned_meta_io_lock;
+       spinlock_t treelog_bg_lock;
+       u64 treelog_bg;
 
 #ifdef CONFIG_BTRFS_FS_REF_VERIFY
        spinlock_t ref_verify_lock;
@@ -1101,7 +1114,7 @@ struct btrfs_root {
 
        u32 type;
 
-       u64 highest_objectid;
+       u64 free_objectid;
 
        struct btrfs_key defrag_progress;
        struct btrfs_key defrag_max;
@@ -2737,6 +2750,7 @@ enum btrfs_flush_state {
        ALLOC_CHUNK_FORCE       =       8,
        RUN_DELAYED_IPUTS       =       9,
        COMMIT_TRANS            =       10,
+       FORCE_COMMIT_TRANS      =       11,
 };
 
 int btrfs_subvolume_reserve_metadata(struct btrfs_root *root,
@@ -3097,15 +3111,14 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
                               u32 min_type);
 
 int btrfs_start_delalloc_snapshot(struct btrfs_root *root);
-int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, u64 nr,
+int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, long nr,
                               bool in_reclaim_context);
 int btrfs_set_extent_delalloc(struct btrfs_inode *inode, u64 start, u64 end,
                              unsigned int extra_bits,
                              struct extent_state **cached_state);
 int btrfs_create_subvol_root(struct btrfs_trans_handle *trans,
                             struct btrfs_root *new_root,
-                            struct btrfs_root *parent_root,
-                            u64 new_dirid);
+                            struct btrfs_root *parent_root);
  void btrfs_set_delalloc_extent(struct inode *inode, struct extent_state *state,
                               unsigned *bits);
 void btrfs_clear_delalloc_extent(struct inode *inode,
@@ -3116,6 +3129,8 @@ void btrfs_split_delalloc_extent(struct inode *inode,
                                 struct extent_state *orig, u64 split);
 int btrfs_bio_fits_in_stripe(struct page *page, size_t size, struct bio *bio,
                             unsigned long bio_flags);
+bool btrfs_bio_fits_in_ordered_extent(struct page *page, struct bio *bio,
+                                     unsigned int size);
 void btrfs_set_range_writeback(struct extent_io_tree *tree, u64 start, u64 end);
 vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf);
 int btrfs_readpage(struct file *file, struct page *page);
@@ -3625,7 +3640,8 @@ static inline int __btrfs_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag)
 /* acl.c */
 #ifdef CONFIG_BTRFS_FS_POSIX_ACL
 struct posix_acl *btrfs_get_acl(struct inode *inode, int type);
-int btrfs_set_acl(struct inode *inode, struct posix_acl *acl, int type);
+int btrfs_set_acl(struct user_namespace *mnt_userns, struct inode *inode,
+                 struct posix_acl *acl, int type);
 int btrfs_init_acl(struct btrfs_trans_handle *trans,
                   struct inode *inode, struct inode *dir);
 #else