]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/btrfs/async-thread.h
btrfs: Add threshold workqueue based on kernel workqueue
[mirror_ubuntu-bionic-kernel.git] / fs / btrfs / async-thread.h
index 1f26792683edf195b48db80992c05acae6fd71f0..3129d8a6128be736166704f6fa3b2cb8854f894b 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2007 Oracle.  All rights reserved.
+ * Copyright (C) 2014 Fujitsu.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public
@@ -118,4 +119,34 @@ void btrfs_init_workers(struct btrfs_workers *workers, char *name, int max,
                        struct btrfs_workers *async_starter);
 void btrfs_requeue_work(struct btrfs_work *work);
 void btrfs_set_work_high_prio(struct btrfs_work *work);
+
+struct btrfs_workqueue_struct;
+/* Internal use only */
+struct __btrfs_workqueue_struct;
+
+struct btrfs_work_struct {
+       void (*func)(struct btrfs_work_struct *arg);
+       void (*ordered_func)(struct btrfs_work_struct *arg);
+       void (*ordered_free)(struct btrfs_work_struct *arg);
+
+       /* Don't touch things below */
+       struct work_struct normal_work;
+       struct list_head ordered_list;
+       struct __btrfs_workqueue_struct *wq;
+       unsigned long flags;
+};
+
+struct btrfs_workqueue_struct *btrfs_alloc_workqueue(char *name,
+                                                    int flags,
+                                                    int max_active,
+                                                    int thresh);
+void btrfs_init_work(struct btrfs_work_struct *work,
+                    void (*func)(struct btrfs_work_struct *),
+                    void (*ordered_func)(struct btrfs_work_struct *),
+                    void (*ordered_free)(struct btrfs_work_struct *));
+void btrfs_queue_work(struct btrfs_workqueue_struct *wq,
+                     struct btrfs_work_struct *work);
+void btrfs_destroy_workqueue(struct btrfs_workqueue_struct *wq);
+void btrfs_workqueue_set_max(struct btrfs_workqueue_struct *wq, int max);
+void btrfs_set_work_high_priority(struct btrfs_work_struct *work);
 #endif