]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/btrfs/ctree.h
Merge tag 'stable/for-linus-3.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / fs / btrfs / ctree.h
index 70c03f5f0953d3482a77726e1600a67e31ef92ac..bc96c03dd259836de717f2ccaabc7b9032d33a34 100644 (file)
@@ -1490,6 +1490,7 @@ struct btrfs_fs_info {
         */
        struct list_head ordered_roots;
 
+       struct mutex delalloc_root_mutex;
        spinlock_t delalloc_root_lock;
        /* all fs/file tree roots that have delalloc inodes. */
        struct list_head delalloc_roots;
@@ -1504,28 +1505,27 @@ struct btrfs_fs_info {
         * A third pool does submit_bio to avoid deadlocking with the other
         * two
         */
-       struct btrfs_workers generic_worker;
-       struct btrfs_workers workers;
-       struct btrfs_workers delalloc_workers;
-       struct btrfs_workers flush_workers;
-       struct btrfs_workers endio_workers;
-       struct btrfs_workers endio_meta_workers;
-       struct btrfs_workers endio_raid56_workers;
-       struct btrfs_workers rmw_workers;
-       struct btrfs_workers endio_meta_write_workers;
-       struct btrfs_workers endio_write_workers;
-       struct btrfs_workers endio_freespace_worker;
-       struct btrfs_workers submit_workers;
-       struct btrfs_workers caching_workers;
-       struct btrfs_workers readahead_workers;
+       struct btrfs_workqueue *workers;
+       struct btrfs_workqueue *delalloc_workers;
+       struct btrfs_workqueue *flush_workers;
+       struct btrfs_workqueue *endio_workers;
+       struct btrfs_workqueue *endio_meta_workers;
+       struct btrfs_workqueue *endio_raid56_workers;
+       struct btrfs_workqueue *rmw_workers;
+       struct btrfs_workqueue *endio_meta_write_workers;
+       struct btrfs_workqueue *endio_write_workers;
+       struct btrfs_workqueue *endio_freespace_worker;
+       struct btrfs_workqueue *submit_workers;
+       struct btrfs_workqueue *caching_workers;
+       struct btrfs_workqueue *readahead_workers;
 
        /*
         * fixup workers take dirty pages that didn't properly go through
         * the cow mechanism and make them safe to write.  It happens
         * for the sys_munmap function call path
         */
-       struct btrfs_workers fixup_workers;
-       struct btrfs_workers delayed_workers;
+       struct btrfs_workqueue *fixup_workers;
+       struct btrfs_workqueue *delayed_workers;
        struct task_struct *transaction_kthread;
        struct task_struct *cleaner_kthread;
        int thread_pool_size;
@@ -1605,9 +1605,9 @@ struct btrfs_fs_info {
        atomic_t scrub_cancel_req;
        wait_queue_head_t scrub_pause_wait;
        int scrub_workers_refcnt;
-       struct btrfs_workers scrub_workers;
-       struct btrfs_workers scrub_wr_completion_workers;
-       struct btrfs_workers scrub_nocow_workers;
+       struct btrfs_workqueue *scrub_workers;
+       struct btrfs_workqueue *scrub_wr_completion_workers;
+       struct btrfs_workqueue *scrub_nocow_workers;
 
 #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
        u32 check_integrity_print_mask;
@@ -1648,7 +1648,7 @@ struct btrfs_fs_info {
        /* qgroup rescan items */
        struct mutex qgroup_rescan_lock; /* protects the progress item */
        struct btrfs_key qgroup_rescan_progress;
-       struct btrfs_workers qgroup_rescan_workers;
+       struct btrfs_workqueue *qgroup_rescan_workers;
        struct completion qgroup_rescan_completion;
        struct btrfs_work qgroup_rescan_work;
 
@@ -1682,6 +1682,11 @@ struct btrfs_fs_info {
        unsigned int update_uuid_tree_gen:1;
 };
 
+struct btrfs_subvolume_writers {
+       struct percpu_counter   counter;
+       wait_queue_head_t       wait;
+};
+
 /*
  * in ram representation of the tree.  extent_root is used for all allocations
  * and for the extent tree extent_root root.
@@ -1718,10 +1723,14 @@ struct btrfs_root {
        struct mutex log_mutex;
        wait_queue_head_t log_writer_wait;
        wait_queue_head_t log_commit_wait[2];
+       struct list_head log_ctxs[2];
        atomic_t log_writers;
        atomic_t log_commit[2];
        atomic_t log_batch;
        int log_transid;
+       /* No matter the commit succeeds or not*/
+       int log_transid_committed;
+       /* Just be updated when the commit succeeds. */
        int last_log_commit;
        pid_t log_start_pid;
        bool log_multiple_pids;
@@ -1797,6 +1806,7 @@ struct btrfs_root {
        spinlock_t root_item_lock;
        atomic_t refs;
 
+       struct mutex delalloc_mutex;
        spinlock_t delalloc_lock;
        /*
         * all of the inodes that have delalloc bytes.  It is possible for
@@ -1806,6 +1816,8 @@ struct btrfs_root {
        struct list_head delalloc_inodes;
        struct list_head delalloc_root;
        u64 nr_delalloc_inodes;
+
+       struct mutex ordered_extent_mutex;
        /*
         * this is used by the balancing code to wait for all the pending
         * ordered extents
@@ -1826,6 +1838,8 @@ struct btrfs_root {
         * manipulation with the read-only status via SUBVOL_SETFLAGS
         */
        int send_in_progress;
+       struct btrfs_subvolume_writers *subv_writers;
+       atomic_t will_be_snapshoted;
 };
 
 struct btrfs_ioctl_defrag_range_args {
@@ -3350,6 +3364,9 @@ int btrfs_init_space_info(struct btrfs_fs_info *fs_info);
 int btrfs_delayed_refs_qgroup_accounting(struct btrfs_trans_handle *trans,
                                         struct btrfs_fs_info *fs_info);
 int __get_raid_index(u64 flags);
+
+int btrfs_start_nocow_write(struct btrfs_root *root);
+void btrfs_end_nocow_write(struct btrfs_root *root);
 /* ctree.c */
 int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key,
                     int level, int *slot);
@@ -3727,7 +3744,8 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
                               u32 min_type);
 
 int btrfs_start_delalloc_inodes(struct btrfs_root *root, int delay_iput);
-int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, int delay_iput);
+int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, int delay_iput,
+                              int nr);
 int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end,
                              struct extent_state **cached_state);
 int btrfs_create_subvol_root(struct btrfs_trans_handle *trans,
@@ -3967,20 +3985,17 @@ do {                                                                    \
 /* 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_init_acl(struct btrfs_trans_handle *trans,
                   struct inode *inode, struct inode *dir);
-int btrfs_acl_chmod(struct inode *inode);
 #else
 #define btrfs_get_acl NULL
+#define btrfs_set_acl NULL
 static inline int btrfs_init_acl(struct btrfs_trans_handle *trans,
                                 struct inode *inode, struct inode *dir)
 {
        return 0;
 }
-static inline int btrfs_acl_chmod(struct inode *inode)
-{
-       return 0;
-}
 #endif
 
 /* relocation.c */