#include <linux/kthread.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/freezer.h>
#include <trace/events/btrfs.h>
#include "async-thread.h"
enum { … };
#define NO_THRESHOLD …
#define DFT_THRESHOLD …
struct btrfs_workqueue { … };
struct btrfs_fs_info * __pure btrfs_workqueue_owner(const struct btrfs_workqueue *wq)
{ … }
struct btrfs_fs_info * __pure btrfs_work_owner(const struct btrfs_work *work)
{ … }
bool btrfs_workqueue_normal_congested(const struct btrfs_workqueue *wq)
{ … }
static void btrfs_init_workqueue(struct btrfs_workqueue *wq,
struct btrfs_fs_info *fs_info)
{ … }
struct btrfs_workqueue *btrfs_alloc_workqueue(struct btrfs_fs_info *fs_info,
const char *name, unsigned int flags,
int limit_active, int thresh)
{ … }
struct btrfs_workqueue *btrfs_alloc_ordered_workqueue(
struct btrfs_fs_info *fs_info, const char *name,
unsigned int flags)
{ … }
static inline void thresh_queue_hook(struct btrfs_workqueue *wq)
{ … }
static inline void thresh_exec_hook(struct btrfs_workqueue *wq)
{ … }
static void run_ordered_work(struct btrfs_workqueue *wq,
struct btrfs_work *self)
{ … }
static void btrfs_work_helper(struct work_struct *normal_work)
{ … }
void btrfs_init_work(struct btrfs_work *work, btrfs_func_t func,
btrfs_ordered_func_t ordered_func)
{ … }
void btrfs_queue_work(struct btrfs_workqueue *wq, struct btrfs_work *work)
{ … }
void btrfs_destroy_workqueue(struct btrfs_workqueue *wq)
{ … }
void btrfs_workqueue_set_max(struct btrfs_workqueue *wq, int limit_active)
{ … }
void btrfs_flush_workqueue(struct btrfs_workqueue *wq)
{ … }